« SQLite3::busyTimeout
SQLite3::close »

SQLite3::changes

(PHP 5 >= 5.3.0, PHP 7, PHP 8)

SQLite3::changes — 直近の SQL 文で変更 (あるいは挿入、削除) された行の数を返す

説明

public function SQLite3::changes(): int

直近の SQL 文で変更 (あるいは挿入、削除) された行の数を返します。

パラメータ

この関数にはパラメータはありません。

戻り値

直近の SQL 文で変更 (あるいは挿入、削除) された行の数を表す int 値を返します。

例

例1 SQLite3::changes() の例

<?php
$db = new SQLite3('mysqlitedb.db');

$query = $db->exec('UPDATE counter SET views=0 WHERE page="test"');
if ($query) {
    echo '変更された行の数: ', $db->changes();
}
?>

関連キーワード:
SQLite   直近   挿入   changes   query   busyTimeout   mysqlitedb   exec   counter   views
関連する関数・ページ:
sqlite3.close   sqlite3result.construct   sqlite3.query   sqlite3.lasterrorcode   sqlite3.version   sqlite3.lastinsertrowid