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 Link to comment https://forums.phpfreaks.com/topic/207168-apostrophes-etc-in-db-causing-a-problem/ 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. Link to comment https://forums.phpfreaks.com/topic/207168-apostrophes-etc-in-db-causing-a-problem/#findComment-1083201 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 Link to comment https://forums.phpfreaks.com/topic/207168-apostrophes-etc-in-db-causing-a-problem/#findComment-1083467 Share on other sites More sharing options...
while1 Posted July 9, 2010 Share Posted July 9, 2010 Take a look at stripslashes() function. Link to comment https://forums.phpfreaks.com/topic/207168-apostrophes-etc-in-db-causing-a-problem/#findComment-1083477 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.