[eluser]Mike Ryan[/eluser]
Hi Datguru,
Are you only seeing one supplier in the dropdown menu? If so, it is because of this line:
Code:
$data['options'] = array( $row->supplier_id => $row->supplier_name);
$data['options'] is being overwritten each time the loop executes, so only the last pair will show in the dropdown. Try this:
Code:
foreach($suppliers as $row)
{
$tmp[] = array( $row->supplier_id => $row->supplier_name);
}
$data['options'] = $tmp;
I only tested this with print_r, but it should work with the dropdown. Also, if mld_supplier_get returns an array consisting only of ID and Name, you could just do:
Code:
$suppliers = $this->mdl_supplier->get();
$data['options'] = $suppliers;
Regards,
Mike