Mysql Query :
SELECT SUM(`Item_qty`), `bill_id`,`Item_name`,`table_id`,`Item_price`
FROM tbl_billmenu
WHERE `table_id` = 30
GROUP BY `Item_name`
How should I've to code/implement this above query in codeigniter module ? please help
Mysql Query :
SELECT SUM(`Item_qty`), `bill_id`,`Item_name`,`table_id`,`Item_price`
FROM tbl_billmenu
WHERE `table_id` = 30
GROUP BY `Item_name`
How should I've to code/implement this above query in codeigniter module ? please help
This is how you do it:
$this->db->select(bill_id,Item_name,table_id,Item_price,sum(Item_qty) as quantity);
$this->db->where('table_id', 30);
$query = $this->db->get('tbl_billmenu');