Jump to content

[SOLVED] ` does not escape with mysql_real_escape_string


Recommended Posts

can anyone tell me if it's normal that the character ` is not escaped when using mysql_real_escape_string to sanitize user imput?

 

I have a login box where if you enter "INSERT INTO database USERS `'`" as username, I am still getting an error message after using mysql_real_escape_string:

 

Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /var/www/vhosts/mydomain.com/httpdocs/index.php on line 41

It's a funny one, most people forget about it or don't realise it even exists, gcc and some text editors complain about it being used at all, so if I were you i'd just scan for it and replace/remove it before your other checks. So will I now you mention it, cheers!

ok I found out that it wasn't the ` that initiated the error message, but a syntax error in the code.

I fixed it and now ` doesn't appear to make any problems anymore when I only use mysql_real_escape_string to sanitize

 

thanks for the replies

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.