APPLY FOR ONLINE Zend Framework Certification

                    
                        $select = new Select('tablename');
$select->columns(array(new Expression('DISTINCT(id) as id')));

public function countFollowers($user_id) 
{
    $select = $this->select()
              ->distinct()
              ->where('user_id = ?', $user_id);

    $rowset = $this->fetchAll($select);
    $rowCount = count($rowset);

    return $rowCount;
}
                    
                


Comment


Back to Top