[eluser]haily_php[/eluser]
I have 4 table in database, now, I want to select all data from those 4 table. And my code:
Code:
$this->db->select("*");
$this->db->join("tableB", "tableB.ID_B=product.ID_B');
$this->db->join("DetailBill","DetailBill.ID_SP=product.idthanhvien");
return $data=$this->db->get("product")->result_array();
And, result is an array that I want (because "Table B" table and "Detail Bill" table relate to "Product" table, but I want to take data from one more table (Table A). Table A only relate to Table B
Code:
$this->db->select("*");
$this->db->join("tableA", "tableA.ID_A=tableB.ID_A');
$this->db->join("tableB", "tableB.ID_B=product.ID_B');
$this->db->join("DetailBill","DetailBill.ID_SP=product.idthanhvien");
return $data=$this->db->get("product")->result_array();
I don't know what do I do to join "Table A" to take data.
Sorry, my english is not well