Codeigniter join where


Codeigniter join where : $this->db->join();and $this->db->where(); is used to join and get data with where conditions in Codeigniter.


Codeigniter join where example


$this->db->select('*');
$this->db->from('users');
$this->db->join('profile_image', 'profile_image.user_id = users.id');
$this->db->where('users.id', $id); 
$query = $this->db->get();

Will produce the query

// Select *from users join profile_image on profile_image.user_id = users.id where users.id = $id


Advertisements

Add Comment

📖 Read More