Friday, June 10, 2016

Join in Codeigniter | How to join two tables using Codeigniter

$this->db->select("USER_ID, FNAME, LNAME, CONCAT(FNAME.' '.LNAME) as FULLNAME UI.EMAIL, UI.AGE, UI.GENDER");
$this->db->from('user_info UI');
$this->db->join('user_details UD','UD.USER_ID=UI.USER_ID');
$this->db->where('USER_ID', $userId);
$result = $this->SelCon->get();
return $result->row_array();