Join three MySQL table to get data from three table follow this code and try it in your web application or Localhost. For example:
// -- My Model -- // $data = $this->db->select('cb.bill_id as cbbillid,cb.fk_category_id,cb.price as cbprice, cb.total_price as cbtprice,bwt.fk_category_id as bwtcid, bwt.total_price as bwttprice, mc.name')->from('create_bill as cb') ->join('materials_category as mc','cb.fk_category_id=mc.id','left') ->join('tax_bill as bwt','cb.bill_id=bwt.bill_id','left') ->where('cb.bill_id',$billid)->get()->result();
I think it will be helpful for you.
Question and answer is powered by AnsPress.io