php, mySQL query character problem

From: Date: Wed, 22 Sep 2004 19:26:59 +0000
Subject: php, mySQL query character problem
Groups: php.general 
Request: Send a blank email to php-general+get-197596@lists.php.net to get a copy of this message
Hi, I have a query to mysql basically saying: $query = "select * from table1 where colum1 like '$email%'"; //where $email is defined string. When i "echo $query", I get the string : select * from table 1 where colum1 like 'testdata%' If i copy paste the string into phpMyAdmin SQL, the query executes successfully and returns one record. However, when I just do $returnValue = QueryDatabase($query); echo mysql_num_rows($returnValue); I always get 0 for the # of records. Does anyone know what causes this? Also... the value i have for $email is from: $email=explode("@",$emailAddress); $email=$email[0]; Thanks, Victor C.

« previous php.general (#197596) next »