Without knowing the actual value of $var, it's hard to say. Assuming the table 'frases' has the requisite fields (frases, palabras) and your sql is indeed returning any results (are you trying to match exactly, or do you mean to do "palabras like '%$var%'" instead of "palabras='$var'" ?) - the only other immediate problem I can see is if you have a field named result or row in the frases table that is messing with your script when you do your extract() call. Curiously - why are you explicitly setting $_GET, do you not have the ability to change php's settings? - Martin Norland, Database / Web Developer, International Outreach x3257 The opinion(s) contained within this email do not necessarily represent those of St. Jude Children's Research Hospital. -----Original Message----- From: luis medrano [mailto:lmzaldivar@xxxxxxxxx] Sent: Wednesday, October 20, 2004 1:45 PM To: php-db@xxxxxxxxxxxxx Subject: making a query with env varable (but is not working) List i have the following code. where i making a query using env variable.but is not working. the value on $var is valid value. any idea how can i make it work? Luis $_GET = $GLOBALS['HTTP_GET_VARS']; $var=$_GET['search_engine']; if (!empty($var)) { print "$var"; $query="SELECT frases FROM frases where palabras='$var'"; $result=mysql_query($query); while ($row=mysql_fetch_assoc($result)){ extract($row); $texto=$row['frases']; } } -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php