I\'m quite frustrated. I want to be able to insert into my database names with single quotes - for example, O\'Connor.
So, when inserting into the DB, I do:
Little edit to the fixinput function to check if your installation of PHP does indeed have real escape string (older versions don't):
function fixinput($value){
if (get_magic_quotes_gpc()){
$value = stripslashes($value);
}
if (function_exists('mysql_real_escape_string')) {
return mysql_real_escape_string($value);
}
else {
return mysql_escape_string($value);
}
}