- 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
Delete Method
The delete
method is a part of the query builder
which is useful for deleting data in a table by execute DELETE
SQL command.
Basic Usage
Here is the basic usage delete
method from $db
property on SENE_Model class.
$this->db->delete(string $table_name [, int $is_debug=0]): boolean
Parameters
This method has 1 required parameter and 1 optional parameter.
$table_name
The name of table that will be deleted.
$is_debug
The $is_debug
parameter is a marker (flag) to enable debug mode.
The value of this parameter can be filled with int 1
to enable debug mode and display the query to be processed.
Fill it with another value to not enable debug mode.
In debug mode, there will be no query execution process to the database system.
Example Usage
Here is the examples using delete
method on blog_model.php file
class Blog_Model extends SENE_Model{
var $tbl = 'd_order';
var $tbl_as = 'dor';
public function __construct(){
parent::__construct();
$this->db->from($this->tbl,$this->tbl_as);
}
public function delete($id){
$this->db->where("id",$id);
return $this->db->delete($this->tbl);
}
}