Welcome Guest, Not a member yet? Register   Sign In
Trying to pass variable from 1 Function to Another to Put in Array within same Model
#8

[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.


Messages In This Thread
Trying to pass variable from 1 Function to Another to Put in Array within same Model - by El Forum - 05-24-2010, 01:52 PM



Theme © iAndrew 2016 - Forum software by © MyBB