I have a simple web form and a simple backend table in MySQL. I am seeing syntax errors in certain posts due to the presences of special characters.
I am using stripslashes($_POST[‘form_field’]) but I still get errors writing to the database.
I am looking for some quick help here to see if anyone knows of the right PHP function to better cleanse my incoming data prior to writing to the table.
I prefer not to test my form, one-by-one, with every single special character (32 in all) to catch and isolate those that are the culprits.
Thanks.
have a look at
mysql_real_escape_string()– that usually works well.