Report new bug | New search | Development Roadmap Status: Open | Feedback | All

Bug #3074 Example 26-1 is incorrect and inconsistent with documentation.
Submitted: 2005-01-01 17:45 UTC
From: jsmith at jssm dot com Assigned: danielc
Status: Bogus Package: Documentation
PHP Version: Irrelevant OS: N/A
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 29 + 17 = ?

 
 [2005-01-01 17:45 UTC] 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.

Comments

 [2005-01-01 17:56 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!