Tuesday, May 17, 2011

Zend Db -> select -> result count

$select = $this->db->select()->from("table_name", array(new Zend_Db_Expr('SQL_CALC_FOUND_ROWS id as count'),'*'));        $select->order('id')->limitPage($page,$limit);

$items = $this->db->fetchAll($select);
$quantity = $this->db->fetchOne('select FOUND_ROWS()');

No comments:

Post a Comment