note 77414 added to function.mysql-escape-string
| From: | mystilon at excite dot com | Date: | Tue, 28 Aug 2007 21:40:31 +0000 |
| Subject: | note 77414 added to function.mysql-escape-string | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-129863@lists.php.net to get a copy of this message | ||
An interesting fact - this function does not work as advertised, at least on my server's verson
of php (5.0.x).
// Assume $_POST['title'] equals "Developer's Nightmare"
$form['title'] = mysql_escape_string($_POST['title']);
print $form['title'];
What you get is: Developer\\\'s nightmare
As opposed to the correct: Developers\'s nightmare
Now whenever you retrieve a record after inserting, the slashes are actually embedded in the data.
Wonderful.
----
Server IP: 209.41.74.194
Probable Submitter: 24.128.177.93
----
Manual Page -- http://www.php.net/manual/en/function.mysql-escape-string.php
Edit -- https://master.php.net/note/edit/77414
Del: integrated -- https://master.php.net/note/delete/77414/integrated
Del: useless -- https://master.php.net/note/delete/77414/useless
Del: bad code -- https://master.php.net/note/delete/77414/bad+code
Del: spam -- https://master.php.net/note/delete/77414/spam
Del: non-english -- https://master.php.net/note/delete/77414/non-english
Del: in docs -- https://master.php.net/note/delete/77414/in+docs
Del: other reasons-- https://master.php.net/note/delete/77414
Reject -- https://master.php.net/note/reject/77414
Search -- https://master.php.net/manage/user-notes.php