- 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
From Method
The from method is used to specify the table from which data will be selected in a database query. This method is part of SENE_Model class and can be combined with other Query Builder methods to build complex queries.
Basic Usage
Here is the basic usage from
method from $db
property on SENE_Model class.
$this->db->from(string $table_name[, string $table_alias=""]): $this->db
Parameters
This method has 1 required parameter and 1 optional parameter.
$table_name
The $table_name
value can contain string that refer to table name.
$alias
The $alias
value can contain about string that aliased the value of $table_name.
This value are required if using the Join Method .
Example
Here is the example for from
in a model class.
class Blog_Model extends \SENE_Model{
var $tbl = 'blog';
var $tbl_as = 'b';
public function __construct(){
parent::__construct();
}
public function countList(){
$this->db->from($this->tbl,$this->tbl_as);
return $this->db->get();
}
}