Today, We want to share with you PHP Codeigniter 3 Multiple WHERE conditions Example.In this post we will show you codeigniter 3 Multiple WHERE Clause with Examples, hear for CodeIgniter 3 PHP $this->db->where() Multiple AND Conditions we will give you demo and example for implement.In this post, we will learn about CodeIgniter 3 Active Record multiple “where” and “or” statements select query with where condition in codeigniter with an example.
PHP Codeigniter 3 Multiple WHERE conditions Example
There are the Following The simple About PHP Codeigniter 3 Multiple WHERE conditions Example Full Information With Example and source code.
also you can read my prev Post Like as self join, left join, multiple joins, sql join multiple tables, with codeigniter join 2 tables, and join 3 tables in codeigniter as well as Join with multiple tables.
As I will cover this Post with live Working example to develop How to use multiple where condition in Codeigniter?, so the some major files and Directory structures for this example is following below.This codeigniter 3 function enables you to set simple WHERE multiple conditions clauses using one List of four methods: where and or condition in codeigniter
- using Simple key/value method
- using Custom key/value method
- using Associative array method
- using Custom string:
Example 1: multiple condition in where clause in codeigniter 3
Custom key/value method via multiple condition in where clause in codeigniter 3 not where condition in codeigniter query
$multipleCIWhere = ['name' => $name, 'email' => $useremail, 'isactive' => $isactive]; $this->db->where($multipleCIWhere); $this->db->get("pakainfo_tblName");
Example 2: codeigniter 3 multiple where condition
Simple key/value method via codeigniter 3 multiple where condition condition array in where clause in codeigniter 3
$multipleCIWhere = ['name !=' => $name, 'id <' => $id, 'isactive >' => $isactive]; $this->db->where($multipleCIWhere); $this->db->get("pakainfo_tblName");
Example 3: Associative array method
multiple where condition codeigniter using Associative array method
$multipleCIWhere = array('name' => $name, 'title' => $title, 'isactive' => $isactive); $this->db->where($multipleCIWhere); // Produces: WHERE name = 'Jaydeep' AND title = 'Gondaliya' AND isactive = 'active'
Example 4: Custom string:
multiple where condition codeigniter using Custom string multiple where condition in update query in codeigniter
$where = "name='Jaydeep' AND title='Gondaliya' OR isactive='active'"; $this->db->where($where);
PHP Codeigniter 3 Multiple WHERE conditions Source code
I hope you get an idea about PHP Codeigniter 3 Multiple WHERE conditions Example.
I would like to have feedback on my Pakainfo.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.
Here are some more FAQ related to this Article: