Complex escape string
| From: | cyaugin | Date: | Sat, 03 May 2008 17:20:07 +0000 |
| Subject: | Complex escape string | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-273839@lists.php.net to get a copy of this message | ||
I have this line of code:
$q = "This is the string that will go into the query:
{${mysql_real_escape_string($_GET['searchstring'])}}";
What happens then is the user supplies 'foo' as the search string, and I get
a debug notice "Undefined variable: foo". Why is it treating the value as an
identifier and how do I make it do what I actually want it to do? This is on
PHP5, latest release.