i trying output values of array drop down menu.
i using pear php data.
if concatenate strings data there, values not set accordingly.
i tried use array_combine
set keys values in drop down. works, 1 result returned (when should 3). concatenation 3 results shown wrongs keys set though.
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[] = null; $keys = null; $arr = null; while ($stdo->fetch()) { $keys = $stdo->id . " | " ; $text = $stdo->title . " | " . $stdo->method . " | " .$stdo->type; $arr = array($keys => $text); $lmst = $arr; }
why array_combine returning 1 value?
dropdown creation code (using html quickforms):
$ddlsoftwaretype = $form->addelement('select', 'ddlsoftwaretype', 'software type', $lmst, array('id' => "softwaretypelist", 'orderby' => "type", "onchange" => "getdetails();"));
expected output (should value key, , 3 columns combined string):
dropdown item:(id value) title | method | type
dropdown item2:(id value) title | method | type
expected (with more items in dropdown - same shown in table):
current output:
i have tried array_combine before, same results.
use array_push($lmst, $arr);
instead of $lmst = $arr;
Comments
Post a Comment