Make sure magic quotes are turned off permanently and never use them.
Rather than using addslashes(), use the correct escaping function for your database (for example mysql_quote() or whatever it's called). That will ensure that all characters are correctly quoted.
Magic quotes are misguided and almost always cause data corruption.
Mark