Db::truncate
Usage
void Db::truncate(string $table_name)Description
Delete all rows in a database table, and reset auto increment column.Parameters
Parameter | Required | Type | Description |
---|---|---|---|
$table_name | Yes | string | The table name to truncate. |
Examples
Truncate Table
$table_name = 'some_table';
$this->db->truncate($table_name);
// All rows have been deleted from the table, and the
// auto-increment column has been reset to 0.