Skip to main content
Version: Fegg 5.x (next)

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​

NameData typeDefaultRemarks
$tablestringTarget table name

Example​

Controller
$db = new \Fegg\Database\Pdo();

// Truncate "sample_log"
$db->truncate('sample_log')->execute();