Bug #3074 [Opn->Bgs]: Example 26-1 is incorrect and inconsistent with documentation.

From: Date: Sat, 01 Jan 2005 17:56:05 +0000
Subject: Bug #3074 [Opn->Bgs]: Example 26-1 is incorrect and inconsistent with documentation.
References: 1  Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-5371@lists.php.net to get a copy of this message
Edit report at http://pear.php.net/bugs/bug.php?id=3074&edit=1 ID: 3074 Updated by: danielc@analysisandsolutions.com Reported By: jsmith at jssm dot com -Status: Open +Status: Bogus Type: Bug Package: Documentation Operating System: N/A PHP Version: Irrelevant -Assigned To: +Assigned To: danielc New Comment: The quotes marks you see in the example contain the string used to create $sql. No quotes marks are used _inside_ the SQL statement. That's the whole point of quoteSmart(). Please brush up on your use of PHP before filing further bug reports. Previous Comments: ------------------------------------------------------------------------ [2005-01-01 12:45:53] jsmith at jssm dot com Description: ------------ The last part of the documentation on the return value of the DB_common::quoteSmart() function states (quote): "other (including strings and numeric strings) -> a string which has been escaped in a DBMS specific way (using escapeSimple()) and then surrounded by single quotes " An example of usage follows this statement and in that example the following SQL statement is built (quote): $sql = 'SELECT * FROM clients WHERE name = ' . $db->quoteSmart($name) . ' AND active = ' . $db->quoteSmart($active); First, a quote is missing from the "AND active = '..." clause. Second, is that quote necessary? The documentation on boolean values says that the value returned is dependant on the DBMS, but none of the DBMS examples shown return a string (all a boolean type or an integer). Third, on the use of $db->quoteSmart($name) I believe the expressed single quotes around that return value are unnecessary as the end of the first quote states that the value returned from quoteSmart() is the properly escaped string argument "surrounded by single quotes." If I am mistaken, I apologize for taking up your valuable time. ------------------------------------------------------------------------ -- Edit this bug report at http://pear.php.net/bugs/bug.php?id=3074&edit=1

« previous php.pear.doc (#5371) next »