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 ?
- How to Check Multiple Checkbox in Angular?
- Laravel Create File Object from Path Example
- PHP Check If String Contains HTML Tags Example
- Find URL in String and Make Link in PHP Example
- Jquery Textarea Auto Increase Height Example
- Laravel Create PDF with Charts Example
- Laravel Add Image to PDF File Example