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

From: Date: Sat, 01 Jan 2005 17:45:54 +0000
Subject: Bug #3074 [NEW]: Example 26-1 is incorrect and inconsistent with documentation.
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-5370@lists.php.net to get a copy of this message
From: jsmith at jssm dot com Operating system: N/A PHP version: Irrelevant Package: Documentation Bug Type: Bug Bug description: Example 26-1 is incorrect and inconsistent with documentation. 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 bug report at http://pear.php.net/bugs/bug.php?id=3074&edit=1 --

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