Click to See Complete Forum and Search --> : MySQL (or maybe PHP) Problem
evenstar7139
07-03-2007, 07:36 PM
On my last server I enjoyed the luxury of having it put a \ in front of all my single quotations in my strings for me so MySQL wouldn't have a heart attack when they were inserted into the database. But I have a my own server now and apparently MySQL (or PHP?) doesn't do that. How do I turn that on?
I'm using PHP 5, if it matters.
evenstar7139
07-03-2007, 07:39 PM
Err nevermind I figured it out! Moderators you can lock this thread.
kvirri
07-05-2007, 10:44 AM
For future reference:
You can either modify the default ini setting " magic_quotes_runtime", or you can use str_replace on the ' and " characters inside your query.
chrisranjana
07-05-2007, 11:57 AM
Yes correct and also you can do it with addslashes (http://www.php.net/addslashes) too