How would I write this SQL the Zend Framework way?
UPDATE register
SET balance = (balance + 10)
WHERE added_date > 1259944184 ;
I can't find any examples of this on Zend's website or the web.
Do I need to use "Zend_Db_Expr"?
acording to zend framwork documentation
use this
$data = array(
'balance' => 'balance + 10'
);
$n = $db->update('register ', $data, 'added_date > 1259944184');
Try this... make sure your model is ready.
$table = new register();
This is the model class
balance=balance+10;
$data = array(
'balance' => 'balance'
);
$where = $table->getAdapter()->quoteInto('added_date > '. 1259944184 );
You can use $where[] for multiple conditions
$table->update($data, $where);