[eluser]Gewa[/eluser]
Hi, I have such problem in my controller. When I take an info of company and join city
Both of them have in the table row “id”
How to rename the ID in City and Region tables while joining them?
Here is part of code
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','left');
$this->db->join('fa_user','fa_user_profile.id=fa_user.id','left');
$this->db->join('t_categories','fa_user_profile.subcat_id=t_categories.subcat_id','left');
$this->db->join('t_main_category','fa_user_profile.cat_id=t_main_category.cat_id','left');
$query=$this->db->get();
$qanak=$query->num_rows();