Welcome Guest, Not a member yet? Register   Sign In
trouble with left join


I'm having sql error saying:

SELECT * from carmodel LEFT JOIN caryear ON caryear.modelID=carmodel.modelID LEFT JOIN carbrand ON caryear.brandID=carmodel.brandID WHERE brandID = '' AND modelID = ''

This is my code for the model
$data = array();
$q = $this->db->get();    
    if ($q->num_rows() > 0)
        foreach ($q->result_array() as $row)
        $data[] = $row;
$q-> free_result();
return $data;

Does anyone know what's wrong with this? Thanks!

nevermind, I found the error.

Theme © iAndrew 2016 - Forum software by © MyBB