I have the following three tables. I am trying to inter link (join) among these three tables like this-
link 1
table1.code=table2.account-code
table1.code=table3.t-code
table2.voucher_no=table3.voucher_no
I tried to query in Codeignitier's way but I get an error message that says table1 is not unique or something like that.
here's what I tried(and got the error)
$this->db->select('*');
$this->db->from('table2');
$this->db->join('table3', 'table2.voucher_no = table3.voucher_no');
$this->db->join('table1', '(table1.code = table2.account_code)');
$this->db->join('table1', '(table1.code = table3.t_code)');
Would you please kindly show me where I did wrong?
If you want to select all three table c my select statment ALso see how join are used i have removed brackets you used in joins.
EDITED
This will produce this query
And for testing purpose
http://brettdewoody.com/labs/active-check/index.php