Welcome Guest, Not a member yet? Register   Sign In
print product category and product in the same page
#2

[eluser]sanir[/eluser]
hi
use following code

Code:
$this->db->select('c.category_name, count(p.product_id)');
$this->db->from('tbl_product p');
$this->db->join('tbl_categroy c','p.categroy_id = c.category_id ','left');
$this->db->group_by('c.category_id');  
$query = $this->db->get();

// SELECT c.category_name, count(p.product_id)
// FROM tbl_product p
// JOIN tbl_category c ON p.category_id = c.category_id
// group by c.category_id

Thanks,
Nasir Ranta


Messages In This Thread
print product category and product in the same page - by El Forum - 05-30-2012, 04:36 AM
print product category and product in the same page - by El Forum - 05-30-2012, 05:09 AM
print product category and product in the same page - by El Forum - 05-30-2012, 09:58 PM



Theme © iAndrew 2016 - Forum software by © MyBB