Click to See Complete Forum and Search --> : do apostrophes ( ' ) mess up querys mysql
marcusami
06-11-2008, 02:21 PM
i have a form that i am handling with php and storing
in a mysql database. it works but if i use an apostrophe
i get an error any ideas?
regards
Marcus
marcusami
06-11-2008, 02:35 PM
never mind yes it does mess it up and u use mysql_real_escape_string to remedy it
$theText = mysql_real_escape_string($theText);
felgall
06-11-2008, 05:19 PM
That is what mysql_real_escape_string is for. If it were not for those characters such as apostrophes that have a special meaning in mySQL then that function would not exist.