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.

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()

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.