[eluser]huskyfritz[/eluser]
Hello there, I just wanna ask help again for the 2nd time in populating records in a dropdown box but its not populating the dropdown box just the way I want...
Here's my code:
Code:
$data_array = array();
$query = $this->db->query("SELECT cTypeID,cTypeDesc FROM muti_tbl_type_prob WHERE lVoid = 0 ORDER BY cTypeID ASC");
foreach ($query->result() as $row) {
$query1 = $this->db->query("SELECT cSystem FROM muti_tbl_system WHERE lVoid = 0 AND cTypeID = " .$row->cTypeID ." ORDER BY cSystem ASC");
foreach ($query1->result() as $row1) {
$data_array[] = array($row->cTypeID, $row->cTypeDesc=>array($row1->cSystem => $row1->cSystem));
}
}
$query1->free_result();
return form_dropdown('type', $data_array,'0',' class="type" id="type-js"');
All I want is to group the records retrieved from muti_tbl_system in every record in muti_tbl_type.
Please help as I am still learning both php and codeigniter. Thanks much!