- 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{
public $table = 'd_order';
public $table_alias = 'dor';
public $table2 = 'b_user';
public $table2_alias = 'bu';
public function __construct(){
parent::__construct();
$this->db->from($this->table,$this->table_alias);
}
public function Ids($ids){
$this->db->select("$this->table_alias.*, $this-table_alias.status_text",'status_text',0);
$this->db->select("$this->table2_alias.fname",'fname',0);
$this->db->select("$this->table2_alias.email",'email',0);
$this->db->where_in("$this->table_alias.id", $ids);
return $this->db->get();
}
}