I have a JOIN query in CodeIgniter which returns an empty array.
My Controller part:
if ($this->session->has_userdata('user')) {
$id = $this->session->user['id'];
$where = ["products.user_id =" => $id];
$status = $this->insertModel->get_status($where);
$this->load->view('profile', ["status" => $status]);
}
My model:
return $this->db
->from('photos')
->join('products', 'photos.prod_id = products.id', 'left')
->where($where)
->get()
->result_array();