Gerald wrote:
Yes Tom is right. addslashes() and friends are NOT the right ways to manipulate the quote character in SQL. Please stop propagating the erroneous use of this Proprietary extension.
The proper ANSI SQL way to have quotes in SQL is to escape ' with ''. E.g.:
insert into t values ('a''b''''c''d')
.. would put the string a'b''c'd into the database.
I don't want my users to have to do escape their quotes them self. Should I use ereg_replace ("'","/"'/"", $myformfield);
for each field in the form before inserting in into the database.
BTW my webserver seems to have magic_quotes_gpc turned off. I developed most of the site on a Linux box and apperently had it turned on by default because I didn't hav e this problem when I developed the site.