Re: Security Best Practice: typecast?
| From: | Chris Shiflett | Date: | Mon, 02 Apr 2007 18:37:08 +0000 |
| Subject: | Re: Security Best Practice: typecast? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-251946@lists.php.net to get a copy of this message | ||
Tijnema wrote:
> use this instead:
> $foo_sql = mysql_real_escape_string($foo_sql,$connection);
Don't escape an entire SQL query.
Escaping helps us provide distinction between the query and the data,
eliminating cases where data can interfere with the format of the query
(SQL injection).
If escaping the entire query actually did anything useful, databases
would do this for us, and we've never be discussing this topic.
Chris
--
Chris Shiflett
http://shiflett.org/