[eluser]dsi[/eluser]
hey,
i m using the following code to fetch data from database but it isn't showing any results, can anyone plz point out what is wrong with my code.
Code:
$tables='product, category, sub_category';
$conditions=array(
'product.category_id'=>'category.id',
'product.sub_category_id'=>'sub_category.id'
);
$offset=$this->uri->segment(3);
$q=$this->db->get_where($tables, $conditions);
if($q->num_rows()>0){
return $q->results();
}
I have used the same statement in phpmyadmin and it shows result. Am i doing anything wrong here??
I used this code in phpmyadmin
Code:
SELECT * FROM product, category, sub_category where product.category_id=category.id and product.sub_category_id=sub_category.id
thank you