MySQL Query problem
| From: | Daniel R. Anderson | Date: | Sat, 10 May 2003 04:23:20 +0000 |
| Subject: | MySQL Query problem | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-147089@lists.php.net to get a copy of this message | ||
When I try:
mysql_query("SELECT * FROM table WHERE something = '{$constraint}'");
(also tried without {}s)
It fails, while when I try:
mysql_query("SELECT * FROM table WHERE something = 'constraint'");
For all those who asked I /did/ echo out the string to show that it's
exactly the same thing. The same query that works when typed in but not
when I try any string concatonation (i.e. $query . $constraint . '\'')or
auto fill (using the variable in the string and letting it expand).
So output is the same thing as a typed in string. Can anybody suggest a
possible fix?
-Dan