Re: [PHP] escaping ' when inside a " "
From: David T-G (davidtg-php_at_justpickone.org)
Date: Mon, 17 Nov 2003 16:43:25 -0500 To: PHP General list <email@example.com>
...and then Adam Williams said...
% If I have the SQL statement:
% $sql = "select subject from subwhile where subject = '*$var*'";
% do I need to put a \ before each '?
1) You should have just tried it.
You owe the Newbie Guide a paragraph on quoting and escaping.
-- David T-G * There is too much animal courage in (play) firstname.lastname@example.org * society and not sufficient moral courage. (work) email@example.com -- Mary Baker Eddy, "Science and Health" http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
- application/pgp-signature attachment: stored