Mystery variable query?
| From: | martin helie | Date: | Thu, 03 May 2001 14:56:39 +0000 |
| Subject: | Mystery variable query? | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-9098@lists.php.net to get a copy of this message | ||
Hello everyone, I hope this hasn't been discussed before (I've looked but
haven't found any answers).
This seems very, very strange, and maybe it's just me but here goes:
PHP 4.0.4
mySQL 3.23.30(gamma)
assuming:
$var="1234"; (type does not seem to matter)
this query returns no error, but no result either:
mysql("database","SELECT * FROM table WHERE id='$var'");
but this works:
mysql("database","SELECT * FROM table WHERE id='1234'");
Uh? I've tried setting the type of the variable to string, to no avail.
I've also tried things like "WHERE id LIKE '%$var%'"...
Help?!
Martin