Here, i will show you how to write multiple condition in where clause using codeigniter 3 Query Builder class. Codeigniter provide set class function for each mysql function like where clause, join etc. So same for where clause, they provide "$this->db->where($array);", so we can use easily.
In this tutorial, you can see two way to add multiple where condition in your codeigniter application. So just let's see both example as below and do it same way:
$multipleWhere = ['name' => $name, 'email' => $email, 'status' => $status];
$multipleWhere = ['name !=' => $name, 'id <' => $id, 'status >' => $status];
As you can see both example.
I hope you find your best....
Do you like below Tutorials ?
- Laravel 5.6 - Collection could not be converted to int
- Laravel - How to generate secure https URL from route?
- Laravel - Vue JS File Upload Example
- How to get last 7 days data in Laravel?
- Laravel Validation required if other field empty example
- Laravel Eloquent - When Case Statement in Select Query Example