Page 1 of 1

php/mysql problem in string with apostrophe character

Posted: Mon Nov 11, 2002 6:06 am
by baskar
I can able to insert the string(sundar's) in database field. but when i display that value it displays like sundar//'s . why is it so and how to solve it. Then i am unable to retrieve the record using this string in query

Please help me to solve this

Posted: Mon Nov 11, 2002 6:08 am
by twigletmac
Use stripslashes() to get rid of the escape character (\) when you are displaying the data from the database.

When you want to test against that record in the database you need to use addslashes() on the string to put the escape characters in.

Mac