Jump to content

[SOLVED] Data not being escaped? - [ Mysqli, phpmyadmin ]


Boo-urns

Recommended Posts

I have my data running through mysqli_real_escape_string before I send it to the database. However I notice when I look at the data in the database it appears to not be escaped. Does the mysqli class automatically escape data? As, I don't think my data is being escaped (when i set it up w/o the real_escape_string) but when I echo out the query it is.

 

Does this version of PhpMyAdmin 2.11.9.4 display data with stripslashes?

 

Thanks!

basically escaping the data is to get it successfully to the database

 

if inside your string somewhere you have a ' it will kill the query

 

thats why it turns ' into \', but when it reaches the database it will have been escaped in the query, therefore it will show up correct in the database, you most likely as wolf states gave magic quotes on, so, you'd want to stripslahes

The escape characters \ are NOT inserted into the database. They are only present in the query string to indicate which special characters are to be treated as data and which are to be treated as part of the query syntax.

The escape characters \ are NOT inserted into the database. They are only present in the query string to indicate which special characters are to be treated as data and which are to be treated as part of the query syntax.

 

^^ yeah basically what I said, but probably more understandable lol

Yes it is. magic_quotes was a failed attempt to make scripts created by unexperiened coders more secure.

magic_quotes is deprecated in PHP5 and will be removed completely in PHP6

http://www.php.net/manual/en/info.configuration.php#ini.magic-quotes-gpc

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.