Welcome Guest, Not a member yet? Register   Sign In
Load drop down box from database
#3

[eluser]maddtechwf[/eluser]
Thanks for the markup. I will change my view code in just a minute. I went through and commented stuff out one by one to see where I was having my issue and it's actually in my controller when I call my model. What have I done wrong there?

Controller
Code:
$data['example_Categories'] = $this->map_model->get_categories("example");

Model
Code:
//Get Gategories
        function get_categories($category_type)
        {
            $return = array();
            
            //DB Connection
            $this->db->select('ID,Name');
            $this->db->from('Category');
            $this->db->where('Type='.$category_type);
            $category_items = $this->db-get();
            
            if ( $cagetory_items > 0)
            {
                foreach ( $category_items->results() as $item)
                {
                    array_push($return, $item);
                }
            }
            return $return;
        }


Messages In This Thread
Load drop down box from database - by El Forum - 05-30-2013, 01:24 PM
Load drop down box from database - by El Forum - 05-30-2013, 03:12 PM
Load drop down box from database - by El Forum - 05-31-2013, 06:13 AM
Load drop down box from database - by El Forum - 05-31-2013, 11:49 AM
Load drop down box from database - by El Forum - 05-31-2013, 12:07 PM
Load drop down box from database - by El Forum - 05-31-2013, 12:12 PM



Theme © iAndrew 2016 - Forum software by © MyBB