ZF-12474: Add update method order parameter

Issue Type: New Feature Created: 2012-11-26T21:07:44.000+0000 Last Updated: 2013-04-05T16:07:09.000+0000 Status: Closed Fix version(s): Reporter: Phillipe Santos Rosário (noisnaaria) Assignee: None Tags: - Zend_Db

Related issues: Attachments:


It is not possible to run a query link this:

UPDATE t SET id = id + 1 ORDER BY id DESC;

                  EXAMPLE OF USE

UPDATE t SET id = id + 1;

For example, if the table contains 1 and 2 in the id column and 1 is updated to 2 before 2 is updated to 3, an error occurs. To avoid this problem, add an ORDER BY clause to cause the rows with larger id values to be updated before those with smaller values:

UPDATE t SET id = id + 1 ORDER BY id DESC;

It would be nice to have an extra param to specify order:

$db->update($table, $where, $order);


Posted by Ralph Schindler (ralph) on 2013-04-05T16:07:09.000+0000

This issue has been closed on Jira and moved to GitHub for issue tracking. To continue following the resolution of this issues, please visit:

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.