I wasn't suggesting that you hard-code the array, only showing you the array structure expected by zen_draw_pull_down_menu function's second parameter. Try making the changes in red:
Code:
//set us up a query to pull all data from our data table
$IEMSquery = "SELECT * from `thedatabase`.`thedatatable`";
//run that query
$result = mysql_query($IEMSquery) or die(mysql_error());
//dump that query into an array
$unit = array();
//while that result exists
while($row = mysql_fetch_array($result)){
//dump the results row by row into the array where the ID number and friendly name match up
$unit[] = array ( 'id' => $row['id'], 'text' => $row['friendly_name']);
// $unit[$row['id']] = $row ['friendly_name'];
};
//and then echo the pull down menu line, call it suburb, and use the unit variable to pass that function its values
echo zen_draw_pull_down_menu('suburb',$unit,'','style="width: 20em;"');
//EOF
Bookmarks