codeigniter get_where multiple conditions

Today, We want to share with you codeigniter get_where multiple conditions.In this post we will show you Codeigniter get_where example, hear for Select Query in Codeigniter with Multiple Clause we will give you demo and example for implement.In this post, we will learn about PHP Codeigniter 3 Multiple WHERE Conditions Example with an example.

How to include multiple condition on get_where in codeigniter?

Codeigniter get_where With Multiple Conditions example

Example 1:

$where_array = array(
               'email'=>'[email protected]',
               'isActive'=>'1'
              );
$table_name = "users";
$limit = 10;
$offset = 0;
$query = $this->db->get_where($table_name,$where_array, $limit, $offset);

SQL Query

SELECT * from users where email='[email protected]' AND isActive ='1' limit 0, 10;

How to use multiple where condition in Codeigniter?

$multipleWhere = ['name !=' => $name, 'id <' => $id, 'isActive >' => $isActive];
$this->db->where($multipleWhere);
$this->db->get("table_name");

OR

$multipleWhere = ['name' => $name, 'email' => $email, 'isActive' => $isActive];

$this->db->where($multipleWhere);

$this->db->get("table_name");

I hope you get an idea about How to use multiple where condition in Codeigniter?.
I would like to have feedback on my infinityknow.com 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.

Leave a Comment