[eluser]D.Phil[/eluser]
Line 48 should be:
Code:
'busid'=> $bus_id[0]['id'],
or you could modify the get bus is function to look like this:
Code:
function get_bus_id() {
$userid = $this->tank_auth->get_user_id();
$this->db->select('b.id');
$this->db->from ('business AS b');
$this->db->where ('b.userid', $userid);
$this->db->limit(1);
$query = $this->db->get();
if ($query->num_rows() > 0) {
$row = $query->row();
return $row->id();
} else return false;
}
What that will do is limit the number of records returned to one.