Cross Join |
Hi,
I have been having a problem with getting cross join to function properly in my project. I need to cross join three tables to produce display results. The model code is this: Code: function immChild() { This query should return on Code: id child immune immun_date id fname lname id name Instead it returns literally a thousand rows. Anyone know what the code should be to cross join three tables?
On your joins you need the condition as second parameter as described here
http://www.codeigniter.com/userguide3/da...light=join As e.g. like this $this->db->join('children as b', 'a.id = b.a_id');
When you JOIN a table without any condition, it will bring ALL the dataset within it.
Hi,
Be careful, a CROSS JOIN returns all rows without filter (immun rows * immun_master rows * children). Agree with Rufnex.
You are absolutely right.
I forgot the condition. Now it works right. Code: function immChild() { |
Welcome Guest, Not a member yet? Register Sign In |