Re: [PHP] escaping ' when inside a " "

From: David T-G (davidtg-php_at_justpickone.org)
Date: 11/17/03


Date: Mon, 17 Nov 2003 16:43:25 -0500
To: PHP General list <php-general@lists.php.net>


Adam --

...and then Adam Williams said...
%
% If I have the SQL statement:
%
% $sql = "select subject from subwhile where subject = '*$var[0]*'";
%
% do I need to put a \ before each '?

1) You should have just tried it.

2) No.

You owe the Newbie Guide a paragraph on quoting and escaping.

HAND

:-D

-- 
David T-G                      * There is too much animal courage in 
(play) davidtg@justpickone.org * society and not sufficient moral courage.
(work) davidtgwork@justpickone.org  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/      Shpx gur Pbzzhavpngvbaf Qrprapl Npg!