[eluser]thefatladysingsopera[/eluser]
I now have this model
Code:
public function das_groups_list($current_id){
$query = $this->db->query("select group_title,group_name from all_groups");
foreach ($query->result() as $row)
{
$data[] = array(
'group_title' => $row->group_title,
'group_name' => $row->group_name
);
}
return $data;
}
and this is the controller
Code:
public function edit_event($id = 0,$current_id=0){
$id = $this->uri->segment(3);
$current_id = $this->ion_auth->get_user_id();
$data['event'] = $this->asgard->das_event_edit($id);
$data['groups'] = $this->asgard->das_groups_list($current_id);
$this->load->view('editevent',$data);
}
I get this array
Code:
Array
(
[0] => Array
(
[group_title] => le_glutten borg
[group_name] => legluttenborg
)
[1] => Array
(
[group_title] => le grand gandalf
[group_name] => legrandgandalf
)
[2] => Array
(
[group_title] => rhyyuj
[group_name] => rhyyuj
)
)
when i
in my view however
Code:
$groups['group_title']
complains of an illegal offset.
Update:
This
Code:
echo $groups[0]['group_title'];
gets me only the first group.How should i list all groups?.
I have this
Code:
<select class="form-control"><option value=""><?php for($i = 0; $i > count($groups); $i++){echo $groups[$i]['group_title'];} ?></option></select>
which does not display any value.