Welcome Guest, Not a member yet? Register   Sign In
How to convert this update QUERY to ActiveRecord
#2

[eluser]Christopher Blankenship[/eluser]
First you have to of course obtain the $row['ord_id'] and then this is what I believe you are looking for:
Code:
$data = array(
   'ord_id' => ($row['ord_id'] - 1),
   );
$this->db->where('ord_id >', $row['ord_id']);
$this->db->update('menu', $data);
Basically this will update the field subtracting 1 from it each time it is accessed.


Messages In This Thread
How to convert this update QUERY to ActiveRecord - by El Forum - 07-03-2007, 05:44 AM
How to convert this update QUERY to ActiveRecord - by El Forum - 07-03-2007, 11:24 PM
How to convert this update QUERY to ActiveRecord - by El Forum - 07-03-2007, 11:26 PM
How to convert this update QUERY to ActiveRecord - by El Forum - 07-03-2007, 11:32 PM
How to convert this update QUERY to ActiveRecord - by El Forum - 07-04-2007, 12:19 AM



Theme © iAndrew 2016 - Forum software by © MyBB