Select Method

The select method purpose is for filtering data from query result by executing SELECT SQL command. This method will put the result SQL command on Query Builder can combined with another Query Builder methods.

Basic Usage

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

$this->db->select(string $column_name): $this->db


This method has 1 required parameters.


The $column_name value can be a single column name of table or can fill with * (wildcard) for selecting all columns.


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

class D_Blog_Model extends SENE_Model{
  var $tbl = 'd_blog';
  var $tbl_as = 'b';
  public function __construct(){
  public function getList(){
    return $this->db->get();
  public function getById($id){
    return $this->db->get_first();

Generated SQL Command

The following is the SQL command generated by the method in the D_Blog_Model class example.

-- result from executing D_Blog_Model::getList() --
SELECT * FROM `d_blog`;

-- result from executing D_Blog_Model::getById(53) --
SELECT `id`, `title`, `content` FROM `d_order` WHERE `id` = 53;