[eluser]mdcode[/eluser]
After trying multiple ways of doing this, and attempting to use your advice bretticus of attempting to "array_combine" the two results so I can use them in the form, I don't think it's going to work this way since the value keys must be the id of the subtype row.
I have done some reworking of the database (to follow along more with CI recommendations) and code (as per recommendations from another user in another thread), and this is how it stands right now:
MODEL:
Code:
/* get all substrates */
function get_all_substrates()
{
$this->db->select('*');
$this->db->from('subtypes');
$this->db->order_by('ssid', 'subtype');
$query = $this->db->get();
$this->db->select('*');
$this->db->from('substrates');
$this->db->order_by('substrate');
$query2 = $this->db->get();
return ($query->num_rows) ? $query->result_array() : FALSE;
return ($query2->num_rows) ? $query2->result_array() : FALSE;
}
CONTROLLER:
Code:
/* grab the substrates list */
if ($substrates = $this->projects_model->get_all_substrates())
{
foreach ($substrates as $key=>$value)
$data['substrates'][$value['id']] = $value['subtype'];
}
And VIEW:
Code:
<?php echo form_dropdown('substrate', $substrates, '', $dds); ?>
I just cannot get the two results into the dropdown...