I have a form with a select element that I need to populate with values from a database. Specifically, the name and id of the current users. The fetchPairs() functi
fetchPairs()
protected function _getSelectOptions() { $db = Zend_Db_Table::getDefaultAdapter(); $select = $db->select()->from('users', array( 'id', 'name' => new Zend_Db_Expr("CONCAT(first_name, ' ', lastname)"), )); return $db->fetchPairs($select); }