Skip to content
This repository has been archived by the owner on May 16, 2018. It is now read-only.

Add update method order parameter #35

Closed
zfbot opened this issue Apr 5, 2013 · 2 comments
Closed

Add update method order parameter #35

zfbot opened this issue Apr 5, 2013 · 2 comments

Comments

@zfbot
Copy link

zfbot commented Apr 5, 2013

Jira Information

Original Issue:ZF-12474
Issue Type:New Feature
Reporter:noisnaaria
Created:11/26/12
Assignee:
Components:Zend_Db

Description

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);

@zfbot
Copy link
Author

zfbot commented Apr 5, 2013

This issue was ported from the ZF2 Jira Issue Tracker at
http://framework.zend.com/issues/browse/ZF-12474

Known GitHub users mentioned in the original message or comment:
@noisnaaria

@froschdesign
Copy link
Member

We will not add any new features or functionality for ZF1.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants