PHP Codeigniter 3 Multiple WHERE conditions Example

PHP Codeigniter 3 Multiple WHERE conditions Example

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 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.

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:

  • 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

$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

$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

$where = "name='Jaydeep' AND title='Gondaliya' OR isactive='active'";
$this->db->where($where);

Codeigniter 3 Query Builder Class

PHP Codeigniter 3 Multiple WHERE conditions Source code

PHP Codeigniter 3 Multiple WHERE conditions Example - PHP Codeigniter 3 Multiple WHERE conditions Example
PHP Codeigniter 3 Multiple WHERE conditions Example
Angular 6 CRUD Operations Application Tutorials

Read :

  Secure Login Remember Me PHP Session and Cookies

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

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.

Leave a Reply

avatar
  Subscribe  
Notify of