I am quite new to Codeigniter. I have a problem wherein it seems my query is not working. Is it because of my format?
Model
$this->db->select('*');
$this->db->from('
store_products,
products,
category,
subcategory,
store,
store_products_category');
$this->db->where('store_products_category.store_id', $marketid);
$this->db->where('store_products_category.subcategory_id', 'subcategory.subcategory_id');
$this->db->where('subcategory.category_id', 'category.category_id');
$this->db->where('store_products_category.storeprod_id', 'store_products.storeprod_id');
$this->db->where('store_products.prod_id', 'products.prod_id');
$this->db->where('store_products_category.store_id', 'store.store_id');
$query = $this->db->get();
$result = $query->row();
return $result;
Controller
if($marketinfo = $this->MarketModel->getInfobyID($marketid)){
$data['marketinfolist'] = $marketinfo;
$this->load->view('layouts/header', $data);
$this->load->view('clickbasket',$data);
$this->load->view('navigation/mainfooter');
$this->load->view('layouts/footer');
}
It seems that it couldn't return anything from the model. I have already tried doing the query directly on phpmyadmin and it works perfectly.