Sherin Green Sherin Green - 1 year ago 115
SQL Question

How to perform AND operation in between two OR_LIKE queries in codeigniter

I perform a multiple search using multiple join query in code igniter so i perform 3 or_like query.But there is an 'OR' placed in between each or_like query by default by code igniter.But actualy i want to perform 'AND' Operation Between them.Please help me.

Answer Source

We can do it very simply in codeigniter version 3.0


    $this ->db ->select('*');
    $this ->db ->where('age',$age);
    $this ->db ->where('country',$country);
    $this ->db ->or_where('state',$state);
    $this ->db ->or_where('district',$district);
    $query=$this ->db ->get('pg_reg');
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download