I am writing a CakePHP 1.2 app. I have a list of people that I want the user to be able to filter on different fields. For each filterable field, I have a drop down list.
You can try this. Here this takes Person id as key, so there is no chance for duplicate entries.
$first_names = $this->Person->find('list', array( 'fields' => array('id','first_name'), 'conditions' => array('Person.status' => '1'), )); $this->set('first_names', $first_names);