-
What's the deal with addslashes()?
I'm working with a database and input from a text field that I want to be html compatible... so... sure, it cause problems with the mysql syntax when the input is transfered to a variable then to the mysql command within quotes if there are quotes in the input.
In short... I figured out that addslashes() works because it makes the quotes characters, not commands, kinda.
My real question is why.
I understand that you're trying to 'escape'... but... does mysql automatically convert to something like what stripslashes() would do in php?
Pretty simple question, but feel free to go into a bit more detai if you want. A simple answer is fine, though.
thanks.
-
-
It basically adds backslashes before any quotes. You would be better advised to use mysql_real_escape_string().
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks