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

From: Date: Sat, 13 Aug 2005 14:34:56 +0000
Subject: note 55797 added to function.mysql-real-escape-string
Groups: php.notes 
Request: Send a blank email to php-notes+get-93556@lists.php.net to get a copy of this message
Note that to use quote_smart(), you have to connect to the database via mysql_connect(). Otherwise, mysql_real_escape_string() will have no way of knowing what database you want to use. If you want to use the OO approach or mysqli_connect(), you're going to have to rewrite quote_smart() to accept a MySQL connection, which it would then pass to mysql_real_escape_string(). This is a pretty lackluster solution, though, for anyone concerned with abstraction. ---- 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+55797 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+55797&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+55797&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+55797&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+55797&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+55797&report=yes&reason=non-english Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+55797&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+55797&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#93556) next »