Zend Framework ORDER BY

zend-framework

Solution

You need to pass the select object to the fetchAll method

public function indexAction()
{
    $this->authoriseUser();
    $this->view->assign('title', 'Clubs');
    $this->view->headTitle($this->view->title, 'PREPEND');
    $clubs = new Application_Model_DbTable_Clubs();
    $select = $clubs->select()
        ->order('club_name ASC');
    $this->view->clubs = $clubs->fetchAll($select);
}

Problem

I have a list of items that I want to order in alphabetical order, heres my code: ``` public function indexAction() { $this->authoriseUser(); $this->view->assign('title', 'Clubs'); $this->view->headTitle($this->view->title, 'PREPEND'); $clubs = new Application_Model_DbTable_Clubs(); $this->view->clubs = $clubs->fetchAll(); $select = $clubs->select(); $select->order('club_name ASC'); } ``` Whats wrong? As it doesn't work.. Thanks

Original source