note 44527 added to function.mysql-escape-string

From: Date: Mon, 09 Aug 2004 02:44:15 +0000
Subject: note 44527 added to function.mysql-escape-string
Groups: php.notes 
Request: Send a blank email to php-notes+get-74281@lists.php.net to get a copy of this message
It just bit me: escaping more than one. I had a statement like: $result = mysql_query(mysql_escape_string($query), $db); And I was getting 1064 from MySQL. After an insane amount of tracing (when I printed the resultant SQL and pasted it at mysql> everything worked!...) I finally found a reason: I was validating/escaping user input before it got to the statement above. Some things were escaped twice, and MySQL went "Huh?!". So watch out for that... ---- Manual Page -- http://www.php.net/manual/en/function.mysql-escape-string.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+44527 Delete -- http://master.php.net/manage/user-notes.php?action=delete+44527&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+44527&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#74281) next »