[eluser]maddtechwf[/eluser]
Okay, so I've got my model and controller working great now. My only issue is my view. This is the error message I get on the screen. "Severity: 4096, Message: Object of class stdClass could not be converted to string, Filename: helpers/form_helper.php, Line Number: 352".
Here is my revised code for my controller, view, and model
Model:
Code:
//Get Gategories
function get_categories($cat_type)
{
$return = array();
//DB Connection
$this->db->select('ID,Name');
$this->db->from('Category');
$this->db->where('Type', $cat_type);
$category_items = $this->db->get();
if ( $category_items->num_rows() > 0)
{
foreach ( $category_items->result() as $item )
{
array_push($return, $item);
}
}
return $return;
}
Controller
Code:
$data['Univ_Categories'] = $this->map_model->get_categories('University');
$data['City_Categories'] = $this->map_model->get_categories('City');
View
Code:
<?php echo form_dropdown('univ-cat', $MSU_Categories); ?>