Re: Sanitizing mysql inserts of user data
| From: | Dotan Cohen | Date: | Sun, 16 Aug 2009 19:23:32 +0000 |
| Subject: | Re: Sanitizing mysql inserts of user data | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-296854@lists.php.net to get a copy of this message | ||
> You should in pretty much all cases be safe with just using the
> mysql_real_escape_string, which takes care of the - for you as well.
>
If I remember correctly, TFM once stated that mysql_real_escape_string
does not prevent SQL injection attacks, though I am hard pressed to
think of what it _is_ for, then. I now see that the manual has this
note:
"Note: If this function is not used to escape data, the query is
vulnerable to SQL Injection Attacks."
Does that necessarily imply this:
"If this function is used to escape data, the query is not vulnerable
to SQL Injection Attacks."?
Logically, it does _not_ mean the same thing.
--
Dotan Cohen
http://what-is-what.com
http://gibberish.co.il