Issue Type: Docs: Problem Created: 2009-02-09T06:55:35.000+0000 Last Updated: 2009-12-15T14:17:54.000+0000 Status: Resolved Fix version(s): - 1.10.0 (27/Jan/10)
Reporter: Mark (lightflowmark) Assignee: Satoru Yoshida (satoruyoshida) Tags: - Zend_Db_Select
Related issues: - ZF-8553
Please update the documentation 188.8.131.52 to reflect new behaviour of where() regarding passed array values. From the code comment:
<pre class="highlight"> * 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
<pre class="highlight"> // 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 ...
Posted by old of Satoru Yoshida (email@example.com) on 2009-02-16T06:59:03.000+0000
Set component and auto reassign
Posted by Satoru Yoshida (satoruyoshida) on 2009-08-26T20:45:17.000+0000
This issue may consist of 3 tasks.
for example in where() now: @param string $value OPTIONAL A single value to quote into the condition. should be : @param mixed $value OPTIONAL A value to quote into the condition.
<pre class="highlight"> This method accepts only one parameter. If you have an expression into which you need to substitute multiple variables, you must format the string manually, interpolating variables and performing quoting yourself.
Posted by Satoru Yoshida (satoruyoshida) on 2009-12-05T21:36:26.000+0000
Solved in SVN trunk r19445 and r19446
Have you found an issue?
See the Overview section for more details.