php - Using primary key as value for dropdown -


i using pear php , html quickforms create dropdown, concatenate results , maintain them in drop down.

code fetches data , concatenates:

do_common::debuglevel(1); $stdo = do_common::factory('softwaretypes'); $lmdo = do_common::factory('licensemethods'); $tdo  = do_common::factory('sldsoftwaretype');  $stdo->selectadd(); $stdo->selectadd('title, method, sldsoftwaretype.type, softwaretypes.id'); $stdo->joinadd($lmdo); $stdo->joinadd($tdo); $stdo->whereadd("softwaretypes.flag <> 1");  $stdo->find(); $lmst = array();  while ($stdo->fetch()) {                     $lmst[] =$stdo->id .  "| " .  $stdo->title . " | " . $stdo->method . " | " .$stdo->type ;                      // $text = array_column($lmst[], $stdo->id); } 

dropdown creation code:

$ddlsoftwaretype = $form->addelement('select', 'ddlsoftwaretype', 'software type', $lmst, array('id' => "softwaretypelist", 'orderby' => "type", "onchange" => "getdetails();")); 

although works want able add id of original table value of dropdown.

is possible?


Comments