September 23rd, 1999, 07:10 PM
I hope someone can help.
when I enter data into my form if there is an
apostrophe in a word (ie, it's , Bob's)and I submit that form it will not record the data.
It will if I omit the apostrophe.
Cn someone please explain why.
September 23rd, 1999, 09:06 PM
I think the problem is within inserting.
You probably have something like this:
$insert = mysql_query("insert into mytable values ('$Field1','$Field2','$Field2','$Field3')");
And when some of those $Field* inholds apostrophe it'll be like this:
"insert into mytable values ('Bob's'...)
So i hope you see what's the problem.
You can fix this by addslashes()-function like this:
$Field1 = addslashes($Field1);
and not like:
Hope it helps! Just remember remove those slashes when you are putting it to web.