I currently am trying the following code:
$sql = $db->query("select id,username,fullname from userss ORDER BY fullname ASC");
while($row = $sql->fetch()) {
$username[] = $row['username'];
}
$form = new Zend_Form();
$form->setAction('/index/change')
->setMethod('post');
$element = new Zend_Form_Element_Select('foo', array(
'multiOptions' => array(
$username,
)));
$form->addElement($element);
echo $form;
The desired result is the <select> form showing the elements <option value='username'>Full Name</option> where username is username from SQL and Full Name is fullname from sql.
Right now, it shows <option value='0'>Full Name</option>
I'm not quite sure how to specify the first part of the array, so that it will essentially be username => Full Name
Any suggestions? Thanks!