note 69283 added to function.pdo-exec
| From: | soletanattoxadotde at osu1 dot php dot net | Date: | Tue, 29 Aug 2006 20:40:14 +0000 |
| Subject: | note 69283 added to function.pdo-exec | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-116486@lists.php.net to get a copy of this message | ||
It's worth noting here, that - in addition to the hints given in docs up there - using prepare,
bind and execute provides more benefits than multiply querying a statement: performance and
security!
If you insert some binary data (e.g. image file) into database using INSERT INTO ... then it may
boost performance of parsing your statement since it is kept small (a few bytes, only, while the
image may be several MiBytes) and there is no need to escape/quote the file's binary data to
become a proper string value.
And, finally and for example, if you want to get a more secure PHP application which isn't
affectable by SQL injection attacks you _have to_ consider using prepare/execute on every statement
containing data (like INSERTs or SELECTs with WHERE-clauses). Separating the statement code from
related data using prepare, bind and execute is best method - fast and secure! You don't even
need to escape/quote/format-check any data.
----
Server IP: 212.124.37.9
Probable Submitter: 88.72.204.63
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.pdo-exec.php
Edit -- https://master.php.net/note/edit/69283
Del: integrated -- https://master.php.net/note/delete/69283/integrated
Del: useless -- https://master.php.net/note/delete/69283/useless
Del: bad code -- https://master.php.net/note/delete/69283/bad+code
Del: spam -- https://master.php.net/note/delete/69283/spam
Del: non-english -- https://master.php.net/note/delete/69283/non-english
Del: in docs -- https://master.php.net/note/delete/69283/in+docs
Del: other reasons-- https://master.php.net/note/delete/69283
Reject -- https://master.php.net/note/reject/69283
Search -- https://master.php.net/manage/user-notes.php