If you are looking to use order by clause in Zend Framework. Please use the below code for the same::
$dbObj = Zend_Db_Table::getDefaultAdapter();
$selectObj = $this->select();
$selectObj->from(array('tbl_users'),array('count(user_id) as id'));
$selectObj->where("username='".mysql_escape_string($Username)."'");
$selectObj->order('username'); // pass the attribute value for order by
$query = $dbObj->query($select);
$usersData = $query->fetchAll();
0 Comment(s)