any one help me.. how to convert in codeigniter : 
SELECT sum(`quantity`) as 'Total Product Sales',product.i_name as 'Product Name' 
FROM `order_details` 
inner join orders on orders.order_id = order_details.order_id and orders.status like 'C' 
inner join product on product.p_id = order_details.product_id 
group by order_details.product_id