note 56920 added to function.mysql-real-escape-string

From: Date: Mon, 19 Sep 2005 15:16:12 +0000
Subject: note 56920 added to function.mysql-real-escape-string
Groups: php.notes 
Request: Send a blank email to php-notes+get-95413@lists.php.net to get a copy of this message
If anyone is using addslashes to escape strings before putting them in the database and thinks they should "upgrade" to mysql_real_escape_string because it is safer (as the instructions above seem to imply): if you read mysql's manual for the function that is being called by php, it says --QUOTE Strictly speaking, MySQL requires only that backslash and the quote character used to quote the string in the query be escaped. This function quotes the other characters to make them easier to read in log files. ENDQOUTE-- So if you're using addslashes, which escapes single and double quote and backslashes, you're OK. ---- Manual Page -- http://www.php.net/manual/en/function.mysql-real-escape-string.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+56920 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+56920&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+56920&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+56920&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+56920&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+56920&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+56920&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+56920&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+56920&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#95413) next »