From Method

From method is part of database class builder for selecting table with its alias.

Parameters

Update method has 2 required parameters that is table name and table alias. Table alias are required for using join and join_method

$this->db->from(string $table_name, string $table_alias): dbObject

$table_name

Table Name refer to table name.

$alias

Alias Aliased name of $table_name.

Example usage

Here is the examples using select method. See the first of this page for full example.

Basic Usage

For example we assumed want to add new data in blog table. First, in the model:

class Blog_Model extends SENE_Model{
  var $tbl = 'blog';
  var $tbl_as = 'b';
  public function __construct(){
	 parent::__construct();
  }
  public function countList(){
    $this->db->select_as("COUNT(*)","total",0);
    $this->db->from($this->tbl,$this->tbl_as);
    return $this->db->get_first();
  }
}