note 20077 rejected from function.mysql-escape-string by sander
| From: | sander@php.net | Date: | Sun, 07 Apr 2002 10:20:29 +0000 |
| Subject: | note 20077 rejected from function.mysql-escape-string by sander | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-28805@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);