note 20077 added to function.mysql-escape-string
| From: | sjohnson at fuzzygroup dot com | Date: | Thu, 21 Mar 2002 14:59:17 +0000 |
| Subject: | note 20077 added to function.mysql-escape-string | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-28041@lists.php.net to get a copy of this message | ||
Reversing mysql_escape_string
Not hard, but not obvious when you are getting started with database programming
If you _correctly_ escape a string before putting it into a MySQL field, then when you retrieve it,
you have to do a string replace to UN_ESCAPE it before displaying it.
If you retrieved a field named addresslistname from a db then do the following:
$addresslistname = $row["addresslistname"];
$addresslistname = str_replace("\'", "'",$addresslistname);
--
http://www.php.net/manual/en/function.mysql-escape-string.php
http://master.php.net/manage/user-notes.php?action=edit+20077
http://master.php.net/manage/user-notes.php?action=delete+20077
http://master.php.net/manage/user-notes.php?action=reject+20077