Welcome Guest, Not a member yet? Register   Sign In
my model function causing memory error
#1

[eluser]Corbee[/eluser]
I don't seem to understand why whenever I called this model to my controller, it crashes

Code:
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 64 bytes) in C:\xampp\htdocs\...\mysql_result.php on line 147

the model
Code:
function getcarbrands()
    {
        $this->db->from('carbrand');
        $this->db->join('caryear','caryear.brandID = carbrand.brandID','left');
        $this->db->join('carmodel','carmodel.brandID = carbrand.brandID','left');
        $this->db->where("price > 0");    
        $q = $this->db->get();
        
        if ($q->num_rows > 0)
        {
            foreach($q->result_array() as $row)
            {
                $data[] = $row;    
            }
            $q->free_result();
            return $data;
        }
    }

Is there something wrong with my code?
#2

[eluser]Corbee[/eluser]
Also does this have something to do with autoload?




Theme © iAndrew 2016 - Forum software by © MyBB