progravix
9-13-07, 02:08 PM
I've written a simple PHP setup that adds, removes, and updated records in a mySQL database. The problem I am having is when I use a single quote (') in any of the html form fields. It gives the error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's House of Fun', '', '', '', '', '', '', '', '', '', '', '', '', '' )' at line 2
I know I have to escape the quotes with a backslash, but this will eventually be in the hands of someone else, and I need it to addslash (which I guess is a PHP function). How in the heck can I do this? I've tried using online tutorial, but they all give errors. Others also warn about "magic_quotes". Does PowWeb have this on? I would assume not since my quotes are not getting escaped.
How can I fix this?
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's House of Fun', '', '', '', '', '', '', '', '', '', '', '', '', '' )' at line 2
I know I have to escape the quotes with a backslash, but this will eventually be in the hands of someone else, and I need it to addslash (which I guess is a PHP function). How in the heck can I do this? I've tried using online tutorial, but they all give errors. Others also warn about "magic_quotes". Does PowWeb have this on? I would assume not since my quotes are not getting escaped.
How can I fix this?