Jump to content


Photo

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


  • Please log in to reply
1 reply to this topic

#1 crouchjay

crouchjay
  • Members
  • PipPip
  • Member
  • 26 posts

Posted 17 May 2006 - 12:00 PM

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

#2 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 17 May 2006 - 02:15 PM

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.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users