Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

escape apostrophe in data string

Status
Not open for further replies.
Jul 28, 2005
358
FR
Hi,

I am developing a site which as part of it stores user text input in a mysql database. This data is place names and various ones have an apostrophe in them. This data is used to dynamically populate drop down boxes and if a place has an apostrphe in it it causes the dropdown to stop working.

Is there a way to escape (\) the apostrophe before it is written to the database so the drop downs work properly?

eg, user input's Cap D'agde in the town field, I want Cap D\'agde to be written to the database.

Thanks,

Richard
 
Hmm, yep thought so after reading up on it after posting here.

Thanks

Richard
 
Thanks again sleepnir, I will definitely look into this one.

Richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top