join query with where condition in codeigniter

Today, We want to share with you left join in codeigniter.In this post we will show you join query in codeigniter controller, hear for codeigniter join 3 tables we will give you demo and example for implement.In this post, we will learn about How To Use Joins In CodeIgniter? with an example.

Codeigniter Inner Join With Multiple Tables

$this->db->join('profile_image', 'profile_image.member_id =');
$this->db->join('city', 'city.member_id =','left');
$this->db->join('post', 'post.member_id =','left');
$this->db->join('friends', 'friends.member_id =','left');
$this->db->where('', $id); 
$query = $this->db->get();


Select *from members
join profile_image on profile_image.member_id =
left join city on city.member_id =
left join post on post.member_id =
left join friends on friends.member_id =
where = $id

codeigniter join 2 table data


$this->db->select(', infinityknow.something, mobile.another')
     ->from('table1 as tamilrokers')
     ->where('', $id)
     ->join('table2 as infinityknow', ' =', 'LEFT')
     ->join('table3 as mobile', ' =', 'LEFT')

I hope you get an idea about delete query in codeigniter.
I would like to have feedback on my blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Read Also:  insert Query In Codeigniter Example Tutorial

Related FAQ

Here are some more FAQ related to this Article:

  1. Read Also:  SQL LEFT OUTER JOIN overview and examples
  2. Read Also:  laravel try catch error handling (exception in controller)
  3. Read Also:  select Query In Codeigniter Example Tutorial
  4. Read Also:  Redirect HTTP To HTTPS Using Laravel Middleware
  5. Read Also:  how to pass array from view to controller?
  6. Read Also:  Laravel 6 Define Table Names in Model
  7. Read Also:  Update Query In Codeigniter Example Tutorial
  8. Read Also:  join query in codeigniter Example Tutorial
  9. Read Also:  Update query in codeigniter Example
  10. Read Also:  insert and display data from database in codeigniter