Jump to content

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


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

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.