note 108482 added to pdo.quote
| From: | orrd101 at gmail dot com | Date: | Mon, 30 Apr 2012 01:15:28 +0000 |
| Subject: | note 108482 added to pdo.quote | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-187405@lists.php.net to get a copy of this message | ||
Despite the recommendation above that you are "strongly recommended" to use
PDO::prepare(), using PDO::quote() with PDO::query() is significantly faster than using prepared
statements (unless you're submitting many identical queries in a sequence). Test data from
several sources shows about a 2-3x speed penalty for using prepared queries if you are only
submitting a single query, and prepared queries only have a speed advantage when you are submitting
thousands of queries from prepared statement at once.
It's also more convenient since less lines of code are required and you don't have to deal
with the challenge of keeping all your ?'s properly ordered to match a separate parameter list
as you do with prepared statements.
So don't let the wording of the description scare you away from using this method.
----
Server IP: 69.147.83.197
Probable Submitter: 99.88.245.232
----
Manual Page -- http://www.php.net/manual/en/pdo.quote.php
Edit -- https://master.php.net/note/edit/108482
Del: integrated -- https://master.php.net/note/delete/108482/integrated
Del: useless -- https://master.php.net/note/delete/108482/useless
Del: bad code -- https://master.php.net/note/delete/108482/bad+code
Del: spam -- https://master.php.net/note/delete/108482/spam
Del: non-english -- https://master.php.net/note/delete/108482/non-english
Del: in docs -- https://master.php.net/note/delete/108482/in+docs
Del: other reasons-- https://master.php.net/note/delete/108482
Reject -- https://master.php.net/note/reject/108482
Search -- https://master.php.net/manage/user-notes.php