First off, I'm frustrated as the devil right now....
I'm trying to give PHP a fair shake after using Perl to connect to MySQL for the past 5 years.
My problem is a simple one. The solution "escapes" me.
I add data to a database that contains a "'", ex., the word "don't".
PHP appears to be automatically escaping the "'" for the add even though I've turned "magic quotes" off in the ini file.
The data goes into the database just fine.
I try updating that record.
No matter what, MySQL refuses to update the record becaused PHP turns the simple commmand:
"update faqs set answer ="Don't use quotes, Dummy" where id=122;"
into
"update faqs set answer ="Don\'t use quotes, Dummy" where id=122;"
which MySQL won't act on.
How do I turn the blasted auto-escaping feature off in PHP?
And if it's on, how do you get a stupidly simple update query like the one above to work?
Yes, I've tried
htmlspecialcharacters($answer);
htmladdslashes($answer);
htmlstripslashes($answer);
I must be doing something wrong. And I've spent way too much time trying to figure out what it is.
Thanks in advance.
Kinney Baughman