GregL83 Posted November 21, 2010 Share Posted November 21, 2010 Hey, I'm trying to run a update using the db adapter object in zend framwork. I want to have simple math in the sql statement using the update function. Is this possible? i.e. $data = array( 'number' => 'number + 1' ); $where = array( 'id = ?' => 1 ); $db->update('sampleTable', $data, $where); Thanks in advance! Link to comment https://forums.phpfreaks.com/topic/219340-zend-framework-db-update-simple-math/ Share on other sites More sharing options...
GregL83 Posted November 21, 2010 Author Share Posted November 21, 2010 That didn't take me long... $data = array( 'number' => new Zend_Db_Expr('number + 1') ); http://framework.zend.com/manual/en/zend.db.adapter.html#zend.db.adapter.write.insert Link to comment https://forums.phpfreaks.com/topic/219340-zend-framework-db-update-simple-math/#findComment-1137369 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.