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 ?
- Disable Back Button in Browser using JQuery
- Angular 9 CRUD for Beginners Step by Step Example
- Angular 8 CRUD Application Example
- How to Get Selected Checkbox Value in JQuery?
- How to Disable Mouse Right Click Cut Copy and Paste using JQuery?
- Codeigniter Create Custom Library Example
- Codeigniter Crop Image Before Upload Example
- React Install Bootstrap 4 Example