Page 1 of 1

mosDBTable Question - Please help!

Posted: Mon Dec 03, 2007 5:46 pm
by muptaface
I have a class that inherits from mosDBtable, I am using it to store() data which comes from form fields.  Everything works fine unless there is an apostrophe entered in the form.  In that case, it appears that a backslash is inserted before the apostrophe in the database.  So if the user enters "It's" it becomes "It\'s".  I understand that this is probably intended as an escape character, but then why is it getting into the database?  Shouldn't it just escape out, leaving the apostrophe itself in the database?

I suspect that for some reason, the string is being "escaped" twice.  So if it starts as "It's", it then becomes "It\'s" which is properly escaped, then "It\\\'s" which is the escaped version of the escaped string, protecting the original backslash as it moves into the database.  But I could be wrong about that.

Thanks in advance.