php - How to write the Sum() method in zend -
hi beginner zend , need queries . trying write following query in zend gives error saying "unrecognized method sum()"
"select tableid
,orderid
,itemid
,sum(itemqty),rate
,sum(itemqty)*rate amount temporder tableid=3 group itemid" in advance
<?php class temporder extends zend_db_table_abstract{ protected $_name="temporder"; public $db; public function init(){ $this->db = zend_registry::get('db'); } public function gettableorder(){ $select = $this->select() ->from($this,array('tableid','orderid','itemid','sum(itemqty)','rate', 'sum(itemqty)' * 'rate' 'amount')) ->where('tableid =3') ->group('itemid'); $data=$this->fetchall($select); return $data; } }
Comments
Post a Comment