I'm using addslashes() to ensure that all my visitors inputted data is safe for inclusion in my database. However, I'm having trouble retrieving this info from my database because of the slashes. For instance, if I have a user who has chosen his user name to be "John's Car" it is turned into "John\'s Car" and then entered into the database. When I try to retrieve this row of data with the following query:
$query = mysql_query("select * from user where name = 'John\'s Car'");
no match is returned. Can anyone tell me what I'm doing wrong?
Many, many thanks,