ldavies83 Posted December 15, 2004 Share Posted December 15, 2004 I've been trying for a couple of hours now to create a pulldown menu based on a table with 2 columns mfrID and mfrText, so display the later but POST the former heres my code so far: $mfr_array = array(); $mfr_query = tep_db_query("select mfrID, mfrText from " . TABLE_PRINTERSEARCH_MFR . " order by mfrText"); while ($mfr = tep_db_fetch_array($mfr_query)) { $mfr_array[] = array('id' => $mfr['mfrID'], 'text' => $mfr['mfrText']); } $contents[] = array('text' => '<br>Manufacturer:<br>' . tep_draw_pull_down_menu('Manufacturer_ID', $mfr_array[], $txtInfo->mfrText)); However, it just gives me an empty pulldown box, I'm sure I'm not addressing the array correctly just dont know how I should do it. Thanks for your help L. Contribs Written: Nochex APC Payment Module, Cheque Payment Module Contribs Updated: Information Pages Unlimited, Latest News V1 You've gotta be Quick on the Draw in this game! Link to comment Share on other sites More sharing options...
ldavies83 Posted December 15, 2004 Author Share Posted December 15, 2004 New Code Listing works, but is not selecting the current Manufacturer $mfr_array = array(); $mfr_query = tep_db_query("select MfrID, Manufacturer from " . TABLE_PRINTERSEARCH_MFR . " order by Manufacturer"); while ($mfr = tep_db_fetch_array($mfr_query)) { $contents[] = array('text' => $mfr['MfrID'] . ' for ' . $mfr['Manufacturer'] . '<br>'); $mfr_array[] = array('id' => $mfr['MfrID'], 'text' => $mfr['Manufacturer']); } $contents[] = array('text' => '<br>Manufacturer:<br>' . tep_draw_pull_down_menu('Manufacturer_ID', $mfr_array, (int)$txtInfo->MfrID)); Contribs Written: Nochex APC Payment Module, Cheque Payment Module Contribs Updated: Information Pages Unlimited, Latest News V1 You've gotta be Quick on the Draw in this game! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.