apostrophe

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
pleigh
Forum Contributor
Posts: 445
Joined: Wed Jan 19, 2005 4:26 am

apostrophe

Post 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
User avatar
Wayne
Forum Contributor
Posts: 339
Joined: Wed Jun 05, 2002 10:59 am

Post 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.
User avatar
pleigh
Forum Contributor
Posts: 445
Joined: Wed Jan 19, 2005 4:26 am

Post by pleigh »

thanks wayne, got it...i used addslashes() and it worked fine....
Post Reply