getAll() and HTML_QuickForm help needed please

From: Date: Mon, 24 Feb 2003 19:48:27 +0000
Subject: getAll() and HTML_QuickForm help needed please
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-3925@lists.php.net to get a copy of this message
Hi everyone, I am real close to getting my first section of code done and I am stuck. I am trying to move a form of mine over to HTML_QuickForm and am not sure how to get the values of an array created with getAll() into my HTML_QuickForm select element. Here is what I have: // query $sql = "SELECT *
       FROM tbl_dra
       WHERE 1
       ORDER BY area ASC";
$qa = $db->getAll($sql, DB_FETCHMODE_ASSOC); if (DB::iserror($qa)){ die($qa->getMessage()); } I currently display this in my form (NOT HTML_QuickForm) as such: // from my form foreach( $qa as $thearea ) { echo "<option value=\"" . $thearea['id' ] . "\">". $thearea ['area' ] . "</option>\n" ; } Looking at the examples in the docs, I see that I need to populate the select like this: $form->addElement('select', 'iselTest', 'Test Select:', array('A'=>'A', 'B'=>'B','C'=>'C','D'=>'D')); But I don't know how to get the array from getAll() into a variable or something I can use in HTML_QuickForm. Thanks for any help, Charles

« previous php.pear.general (#3925) next »