Jump to content

Archived

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

crouchjay

Value 'Dont Care' is excepted but not 'Don't Care'

Recommended Posts

MySQL or maybe MyISAM table does not except the latter value. How do I get around this?

$x="Dont Care"

$y="Don't Care";

INSERT INTO table SET column = '$x' <----inserts

INSERT INTO table SET column = '$y' <----Does not insert

Share this post


Link to post
Share on other sites
A single-quote is a special character, which means that it needs to be escaped (i.e. predeeded) with a backlash. Just be careful, since PHP also supports escaping quotes, meaning that if you might have to escape it twice, depending on how you declare your string ilterals. In this case, since your string is in doubles, you shouldn't have a problem.

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.