Re: [PHP] Complex escape string

[email protected] (Casey)
Newsgroups php.general
Message-ID <[email protected]>
On 5/3/08, cyaugin <[email protected]> wrote:
> 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.
>
>
>
>
>  --
>  PHP General Mailing List (http://www.php.net/)
>  To unsubscribe, visit: http://www.php.net/unsub.php
>
>
$q = "This is the string that will go into the query: " .
mysql_real_escape_string($_GET['searchstring']);

-- 
-Casey
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.