getTablesArray() as $table) { if (!$db->query('TRUNCATE TABLE ' . $table)) { throw new Exception('Failed to truncate database'); } } } elseif (!$db->query('TRUNCATE TABLE ' . $table)) { throw new Exception('Failed to truncate table: ' . $table); } } }