mwouters Posted July 20, 2006 Share Posted July 20, 2006 Hello,When I insert a word in mySQL which contains a single quote, I escape it using addslashes($word);When I do an export of my database I get this:VALUES (2, 'kleuter', 'Gods\\'' dienst',When I try to get it out of the database I don't get any results using:SELECT * FROM `uitgaven` WHERE leermiddel='Gods\' dienst'It looks like mysql escapes the \ and the quote seperately???How can I get this to work?Thanks a lot!Mark. Link to comment https://forums.phpfreaks.com/topic/15146-problem-with-single-quotes-in-mysql/ Share on other sites More sharing options...
ChaosXero Posted July 20, 2006 Share Posted July 20, 2006 Try using mysql_real_escape_string on your variables when you insert them, instead of addslashes. Link to comment https://forums.phpfreaks.com/topic/15146-problem-with-single-quotes-in-mysql/#findComment-61038 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.