note 79060 added to function.mysql-query
| From: | Geert at osu1 dot php dot net | Date: | Thu, 08 Nov 2007 15:04:51 +0000 |
| Subject: | note 79060 added to function.mysql-query | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-132114@lists.php.net to get a copy of this message | ||
@ x_terminat_or_3 at yahoo dot fr
10-Mar-2007 12:27
"However, I read somewhere that it is good practice to add a semicolon at the end of your
query, and that it increases security against SQL-injection attacks. Therefore I have issued a
requirement that all my developers end queries with semicolons."
Erm... I don't believe you've understood the principle of executing one query at the same
time, as the manual explains. Suffixing your query with a semicolon does not influence vulnerability
to SQL-injection; as PHP would otherwise add the semicolon by itself at the end of your query.
Better instruct your developers that they use mysql_real_escape_string and surround user input in
queries with single quotes (').
----
Server IP: 83.137.20.135
Probable Submitter: 84.244.141.74
----
Manual Page -- http://www.php.net/manual/en/function.mysql-query.php
Edit -- https://master.php.net/note/edit/79060
Del: integrated -- https://master.php.net/note/delete/79060/integrated
Del: useless -- https://master.php.net/note/delete/79060/useless
Del: bad code -- https://master.php.net/note/delete/79060/bad+code
Del: spam -- https://master.php.net/note/delete/79060/spam
Del: non-english -- https://master.php.net/note/delete/79060/non-english
Del: in docs -- https://master.php.net/note/delete/79060/in+docs
Del: other reasons-- https://master.php.net/note/delete/79060
Reject -- https://master.php.net/note/reject/79060
Search -- https://master.php.net/manage/user-notes.php