ZF-2863: Zend_Db_Table - Improvement for "where" parameter in update() method

Issue Type: Improvement Created: 2008-03-11T12:24:38.000+0000 Last Updated: 2009-12-21T11:26:01.000+0000 Status: Resolved Fix version(s): - 1.10.0 (27/Jan/10)

Reporter: Mathieu Decaffmeyer (mathi) Assignee: Ryan Mauger (bittarman) Tags: - Zend_Db_Table

Related issues: - ZF-7626




When inserting or fetching in a DB, the where condition must be of the following syntax (when using an array):

$where = array( 'id_photo = ?' => $pic, 'member_id = ?' => $memberId );

But when updating, the above where condition will generate a wrong Sql, and need to apply another syntax , like this one:

$where = array( $db->quoteInto('id_photo = ?', $pic), $db->quoteInto('member_id = ?', $memberId) );

This is pretty quite confusing and incoherent Also, when the first syntax is used in the update method, the whole records can change.


Posted by Wil Sinclair (wil) on 2008-03-25T20:23:59.000+0000

Please categorize/fix as needed.

Posted by Mathieu Decaffmeyer (mathi) on 2008-09-08T07:17:53.000+0000

If I'm not wrong, the same happens with the parameter of delete function

Posted by Wil Sinclair (wil) on 2009-01-13T10:38:33.000+0000

Reassigning to Ralph to bring closure to this issue.

Posted by Ryan Mauger (bittarman) on 2009-10-19T00:47:14.000+0000

Is there any update on this issue?

What is the "wrong" SQL syntax which is produced?

Posted by Ryan Mauger (bittarman) on 2009-11-17T11:33:54.000+0000

Closing, as no further update supplied. Correct method for parameter binding for both update and delete methods has been added to the docs since this issue was opened. see ZF-7626 for more details

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.