I do prefer to use mysql_real_escape_string, but a site I am working for has their own escape function, mainly for names etc so comments do not matter!
Thanks for the info, I also read
Code:
This function must always (with few exceptions) be used to make data safe before sending a query to MySQL
too which is why I was curious about how secure not using it would be.
I guess the logic is that stripslashes would take out all slashes, and then addslashes would escape any charcters that need escapeing as in the PHP manual it states:
Code:
Returns a string with backslashes before characters that need to be quoted in database queries etc
It replaces ' and " so that if data is taken out, processed in some way and then put back into a table (if it contained a ') it will not have to be escaped again.