Welcome Guest, Not a member yet? Register   Sign In
Please help on JOIN problem
#1

[eluser]Gewa[/eluser]
Here i have a code that helps to take companies, and attach the city table
Code:
$this->db->select('*');
                 $this->db->from('fa_user_profile');
                 $this->db->where('type','company');
                 $this->db->join('city','fa_user_profile.city_id=city.id');
                 $this->db->join('fa_user','fa_user_profile.id=fa_user.id');


                 $query=$this->db->get();


The problem is that when lets say in the fa_user_profile table there is a row, that contains lets say city_id=4 and in city table there is no such city with ID 4, then this row is not shown in listing. How to organize the JOIN, that in such case it is joining city field to the result row with "0" result or anything else... ??????


Messages In This Thread
Please help on JOIN problem - by El Forum - 10-06-2008, 09:56 AM
Please help on JOIN problem - by El Forum - 10-06-2008, 10:11 AM
Please help on JOIN problem - by El Forum - 10-06-2008, 10:36 AM
Please help on JOIN problem - by El Forum - 10-06-2008, 02:01 PM



Theme © iAndrew 2016 - Forum software by © MyBB