Weird things happening with mysql
| From: | Daniel R. Anderson | Date: | Fri, 09 May 2003 14:32:49 +0000 |
| Subject: | Weird things happening with mysql | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-147028@lists.php.net to get a copy of this message | ||
I have a $query for mysql that looks something like:
$query = "SELECT * FROM table WHERE value = 'foo'";
If I mysql_query with foo typed in it works like a charm. If however I
try to:
$query = "SELECT * FROM table WHERE value = '" . $_POST['foo'] .
"'";
$result = mysql_query($query);
The query succeeds but returns an empty $result. (I know there is an
entry in the table with foo (Primary Key).
Anybody have any ideas why this might be?
Thanks,
-Dan