Pdo::truncate
Set truncate query
Description
public self Pdo::truncate( string $table )
Builds Truncate "table", which removes every row. MySQL only: SQLite has no TRUNCATE (use delete without a condition there).
Arguments
| Name | Data type | Default | Remarks |
|---|---|---|---|
| $table | string | Target table name |
Example
Controller
$db = new \Fegg\Database\Pdo();
// Truncate "sample_log"
$db->truncate('sample_log')->execute();