Jump to content

[SOLVED] Addslashed data not appearing slashed in Mysql Query Browser?


little_webspinner

Recommended Posts

I noticed something strange yesterday when I input data into mysql from php.  Before inserting the information I performed addslashes on the data.  I then checked the info with the Query Browser and I found that the data that was inserted in the operation did not appear to have slashes on the quotes. 

 

Is this normal?  I thought it very odd.  Does Mysql's query browser automatically disregard slashes when displaying data in db fields?  This was something I had not noticed before. Is something amiss?

 

Magic quotes are disabled in PHP btw.

Link to comment
Share on other sites

Is this normal?

Yes. The escape characters are only in the data in the query string (so that the special characters in the data don't break the syntax of the query) , not in the actual data in the database.

 

addslashes() does not escape all the special characters that can break a query. You need to use mysql_real_escape_string()

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.