note 113335 added to pdo.quote

From: Date: Sat, 28 Sep 2013 12:40:16 +0000
Subject: note 113335 added to pdo.quote
Groups: php.notes 
Request: Send a blank email to php-notes+get-196401@lists.php.net to get a copy of this message
When converting from the old mysql_ functions to PDO, note that the quote function isn't exactly the same as the old mysql_real_escape_string function. It escapes, but also adds quotes; hence the name I guess :-) After I replaced mysql_real_escape_string with $pdo->quote, it took me a bit to figure out why my strings were turning up in results with quotes around them. I felt like a fool when I realized all I needed to do was change ...\"".$pdo->quote($foo)."\"... to ...".$pdo->quote($foo)."... ---- Server IP: 69.147.83.199 Probable Submitter: 203.129.23.146 ---- Manual Page -- http://php.net/manual/en/pdo.quote.php Edit -- https://master.php.net/note/edit/113335 Del: integrated -- https://master.php.net/note/delete/113335/integrated Del: useless -- https://master.php.net/note/delete/113335/useless Del: bad code -- https://master.php.net/note/delete/113335/bad+code Del: spam -- https://master.php.net/note/delete/113335/spam Del: non-english -- https://master.php.net/note/delete/113335/non-english Del: in docs -- https://master.php.net/note/delete/113335/in+docs Del: other reasons-- https://master.php.net/note/delete/113335 Reject -- https://master.php.net/note/reject/113335 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#196401) next »