- Seme Framework
- version 4.0.3
- Requirements
- Download & Install
- Configuration
- Tutorials
- URI Routing
- Constants
- Global Variables
- Model
- View
- Controller
- cdn_url
- config
- constructor
- getAdditional
- getAdditionalBefore
- getAdditionalAfter
- getAuthor
- getCanonical
- getContentLanguage
- getDescription
- getIcon
- getJsContent
- getJsFooter
- getJsReady
- getKey
- getKeyword
- getLang
- getRobots
- getShortcutIcon
- getThemeElement
- getTitle
- input
- lib
- load
- loadCss
- loadLayout
- putThemeContent
- putJsContent
- putJsFooter
- putJsReady
- render
- resetThemeContent
- session
- setAuthor
- setCanonical
- setContentLanguage
- setDescription
- setIcon
- setKey
- setKeyword
- setLang
- setShortcutIcon
- setTheme
- setTitle
- Library
- CLI (command line interface)
- Core
- Issue
- Deployment
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;
Parameters
This method has 2 required parameters.
$column_name
The $column_name
value can be column name of table or full qualitfied name.
$array_selector
The $array_selector
value can be an array contains the value for filtering data.
$is_not
The $is_not
for where not in
operation if value is equal 1.
Example
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(){
parent::__construct();
$this->db->from($this->tbl,$this->tbl_as);
}
public function Ids($ids){
$this->db->select("$this->tbl_as.*, $this-tbl_as.status_text",'status_text',0);
$this->db->select("$this->tbl2_as.fname",'fname',0);
$this->db->select("$this->tbl2_as.email",'email',0);
$this->db->where_in("$this->tbl_as.id", $ids);
return $this->db->get();
}
}