Where in Method

The where_in method is part of database class builder for filtering data compatible with WHERE IN Clause on SQL. This method support chained as well.

Basic Usage

Here is the basic usage where_in method from $db property on SENE_Model class.

$this->db->where_in(string $column_name, array $array_selector[, int $is_not=0]): $this->db;


This method has 2 required parameters.


The $column_name value can be column name of table or full qualitfied name.


The $array_selector value can be an array contains the value for filtering data.


The $is_not for where not in operation if value is equal 1.


Here is the examples using where_in method in a model class.

class Blog_Model extends SENE_Model{
  var $tbl = 'd_order';
  var $tbl_as = 'dor';
  var $tbl2 = 'b_user';
  var $tbl2_as = 'bu';
  public function __construct(){
  public function Ids($ids){
    $this->db->select("$this->tbl_as.*, $this-tbl_as.status_text",'status_text',0);
    $this->db->where_in("$this->tbl_as.id", $ids);
    return $this->db->get();