You should always check a foreach variable is not empty before doing the foreach loop. The error is telling you your variable is not set. If it is not set, but you are trying to set it with your model call, then your model must not be returning the values you expected.
Looking at your models called function, which looks fine, are you sure you have any data in the table you refer to?
PS You could write it like this btw:
PHP Code:
public function header_warenkorbs()
{
return $this->db->select('*')
->from('db_artikel')
->get()
->result_array();
}
And since select * is the default, and get accepts a table name, you could do:
PHP Code:
public function header_warenkorbs()
{
return $this->db->get('db_artikel')->result_array();
}
Paul