ZF-5718: Update the documentation 22.214.171.124 to reflect new behaviour regarding passed array values
Please update the documentation 126.96.36.199 to reflect new behaviour of where() regarding passed array values. From the code comment:
* If a value is passed as the second param, it will be quoted * and replaced into the condition wherever a question-mark * appears. Array values are quoted and comma-separated.
Suggest alteration: "The second argument to the where() method is optional. It is a value to substitute into the expression. Zend_Db_Select quotes the value and substitutes it for a question-mark ("?") symbol in the expression. Array values are quoted and comma-separated, e.g. for use in IN clauses."
A code sample could be
// Build this query: // SELECT product_id, product_name, price // FROM "products" // WHERE name IN ('O\'Reilly','McIntosh','Amazon') $nameArray=array("O'Reilly","McIntosh","Amazon"); $select = $db->select() ->from('products', array('product_id', 'product_name', 'price')) ->where('product_name IN ?',$nameArray);
I spent some time writing code to do this myself before I read the where() function comment ...