Page 1 of 1

apostrophe

Posted: Fri Feb 18, 2005 3:27 am
by pleigh
i was wondering what to code for the database to accept apostrophe and/or quotation marks. i used stripslashes but the database dows not accept ' ' and " ".

what could be the problem?

thanks.

pleigh

Posted: Fri Feb 18, 2005 3:53 am
by Wayne
its not the database that is not accepting them, you are not escaping these characters properly in your coding and that is forming an incorrect SQL statement. Try escaping the characters, look into mysql_escape_string() or addslashes() to start, depends on what database you are using.

Posted: Fri Feb 18, 2005 3:56 am
by pleigh
thanks wayne, got it...i used addslashes() and it worked fine....