Hi Guys,
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:
Example 1:
$multipleWhere = ['name' => $name, 'email' => $email, 'status' => $status];
$this->db->where($multipleWhere);
$this->db->get("table_name");
Example 2:
$multipleWhere = ['name !=' => $name, 'id <' => $id, 'status >' => $status];
$this->db->where($multipleWhere);
$this->db->get("table_name");
As you can see both example.
I hope you find your best....
Do you like below Tutorials ?
- Angular Json Pipe Example | Json Pipe in Angular 9/8/7
- Angular Slice Pipe Example | Slice Pipe in Angular 9/8/7
- Angular Uppercase Pipe Example | Uppercase Pipe in Angular 9/8/7
- Angular LowerCase Pipe Example | LowerCase Pipe in Angular 9/8/7
- Angular Titlecase Pipe Example | Titlecase Pipe in Angular 9/8/7
- Angular KeyValue Pipe Example | KeyValue Pipe in Angular 9/8/7
- Call Method from One Component to Another Component in Angular
- Angular Push Object into Array Example