simonp Posted July 8, 2010 Share Posted July 8, 2010 Hi, In my MySQL db, I have sentences like: Dave's cat is called Flossy But the apostrophe is causing problems with my script - is there something I need to do when I get the data from the db to fix this? Cheers Simon Quote Link to comment Share on other sites More sharing options...
Alex Posted July 8, 2010 Share Posted July 8, 2010 You should run all data through mysql_real_escape_string before inserting it into the database. Quote Link to comment Share on other sites More sharing options...
simonp Posted July 9, 2010 Author Share Posted July 9, 2010 Cheers AlexWD, Unfortunately now it displayed the text escaped eg: Dave/'s cat is called Flossy Any tips? Simon Quote Link to comment Share on other sites More sharing options...
while1 Posted July 9, 2010 Share Posted July 9, 2010 Take a look at stripslashes() function. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.