Forum Moderators: coopster
$string = stripslashes($string);
Usually you want PHP to add the slashes, otherwise you'll have problem with you query. Imagine if someone enters: "I don't care" in your form field "field1".
Then you
$query = "UPDATE table1 SET(field1='$_POST['field1']');
PHP will evaluate this as
$query = "UPDATE table1 SET(field1='I don't care');
That will give you a parse error because of the quotes. So you need
$query = "UPDATE table1 SET(field1='I don\'t care');
The trick is that you may need to strip the slashes at the other end, so before you output your string, you need to do this:
$cares = stripslashes($cares);
Tom