Jump to content

Archived

This topic is now archived and is closed to further replies.

mwouters

Problem with single quotes in mysql

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Try using mysql_real_escape_string on your variables when you insert them, instead of addslashes.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.