From 1443a4be7694b377d34307c5fef6b7bcda1c9d6c Mon Sep 17 00:00:00 2001 From: Aidan Lister Date: Mon, 20 Sep 2004 08:52:55 +0000 Subject: [PATCH] Split second example in two git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@168837 c90b9560-bf6c-de11-be94-00142212c4b1 --- .../mysql/functions/mysql-real-escape-string.xml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/reference/mysql/functions/mysql-real-escape-string.xml b/reference/mysql/functions/mysql-real-escape-string.xml index bc5d18135b..e26638de4d 100644 --- a/reference/mysql/functions/mysql-real-escape-string.xml +++ b/reference/mysql/functions/mysql-real-escape-string.xml @@ -1,5 +1,5 @@ - + @@ -106,10 +106,16 @@ SELECT * FROM users WHERE name='aidan' AND password='' OR 1=1 This would allow anyone to log in without a valid password. + + + + + A "Best Practice" query Using mysql_real_escape_string around each variable - prevents this. This example demonstrates the proper method for querying a database, - independent of the Magic Quotes setting. + prevents SQL Injection. This example demonstrates the "best practice" + method for querying a database, independent of the + Magic Quotes setting.