Welcome Guest, Not a member yet? Register   Sign In
What's the difference?
#1

[eluser]gypmaster[/eluser]
Hi,

Been away from CI for a good while now (never really got too far into it previously) and just trying to get back into it now. Got a question about database functions ... what's the difference between:

Code:
function get_records()
    {
        $query = $this->db->get('data');
        $q=$query->result();
        $query->free_result();
        return $q;    
    }

and ...

Code:
function get_records()
    {
        $Q = $this->db->get('data');
        if ($Q->num_rows() > 0)
            {
                foreach ($Q->result() as $row)
                    {
                        $data[] = $row;
                    }
            }
        $Q->free_result();
        return $data;        
    }


Messages In This Thread
What's the difference? - by El Forum - 02-25-2011, 02:52 AM
What's the difference? - by El Forum - 02-25-2011, 06:41 AM
What's the difference? - by El Forum - 02-25-2011, 10:03 AM
What's the difference? - by El Forum - 02-25-2011, 10:19 AM
What's the difference? - by El Forum - 02-25-2011, 10:56 AM



Theme © iAndrew 2016 - Forum software by © MyBB