Im having a small problem with storage of special characters like quotes, double quotes and ampersands. I put every POST request through mysql_real_escape_string(), and when I add a string like "That '70s Show" it gets stored as "That '70s Show" in the mysql DB. When I echo it out, it works fine… but when I try to run a % $string % search for "That '70s Show", it will not find the record. I have magic_quotes disabled.
How can I get around this?
It looks like the problem is that you’re not just running the incoming data that you store in the database through
mysql_real_escape_string(), but alsohtmlentities()or a relative. Is that the case? If so, quit. 🙂