I want the code that I if I found the field data then I want to join that particular data to another table.
$this->db->select('*');
$this->db->from('userprofile');
$this->db->where('userId', $userId);
$this->db->where('status', 1);
$this->db->join('bodytype', 'bodytype.bodyTypeId = userprofile.bodyType');
$this->db->join('children', 'children.childrenId = userprofile.children');
$this->db->join('ethnticity', 'ethnticity.ethnticityId = userprofile.ethnicity');
$this->db->join('smoke', 'smoke.smokeId = userprofile.smoke');
$this->db->join('drink', 'drink.drinkId = userprofile.drink');
$query = $this->db->get();
return $query->result();
If I got the userprofile.bodyType then and then the bodytype joinquery run.Is there any way to handle it?