milesap Posted July 9, 2009 Share Posted July 9, 2009 Hello Everyone, I was wondering if there is a way to alter the values returned from MySQL within the Zend_Db_Table_Abstract class. Bear with me, I'll give you an example of what I mean! I fetch rows like this: $billing = new Billing(); //(Zend_Db_Table_Abstract class) $getRow = $billing->fetchRow($billing->select()->where('id = ?', 1)); The above returns all columns in my billing table, say transaction and price where id = 1, good so far. Now is it possible to alter, say price, in the Zend_Db_Table_Abstract class? I know how to alter data for update and insert in Zend_Db_Table_Abstract: public function update(array $data) { $data['price'] = '$10'; return parent::update($data); } but not sure how to do this for data that's retrieved from the database. Can anyone point me in the right direction or have a solution, I just can't figure it out. Thanks in advance! Quote Link to comment https://forums.phpfreaks.com/topic/165295-question-for-zend_db/ Share on other sites More sharing options...
bonaparte Posted August 2, 2009 Share Posted August 2, 2009 You can do whatever you want to with the returned rowset. Display, edit or delete the returned object or array. Why would you want to do it at the SQL level? Quote Link to comment https://forums.phpfreaks.com/topic/165295-question-for-zend_db/#findComment-888723 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.