PHP 手冊
前一頁 |  | 下一頁

# sqlite_changes

(PHP 5)

sqlite_changes

(no version information, might be only in CVS)

SQLiteDatabase->changes -- Returns the number of rows that were changed by the most recent SQL statement

## Description

int sqlite_changes ( resource dbhandle )

Object oriented style (method):

class SQLiteDatabase {
int changes ( void )
}

Returns the numbers of rows that were changed by the most recent SQL statement executed against the dbhandle database handle.

範例 1. sqlite_changes() example

`<?php
$dbhandle = sqlite_open('mysqlitedb');
$query = sqlite_query($dbhandle, "UPDATE users SET email='jDoe@example.com' WHERE username='jDoe'");
if (!$query) {
exit('Error in query.');
} else {
echo 'Number of rows modified: ', sqlite_changes($dbhandle);
}
/* OO Example */
$dbhandle = new SQLiteDatabase('mysqlitedb');
$query = $dbhandle->query("UPDATE users SET email='jDoe@example.com' WHERE username='jDoe'");
if (!$query) {
exit('Error in query.');
} else {
echo 'Number of rows modified: ', $dbhandle->changes();
}
?>`

See also sqlite_num_rows().

前一頁 | 內容 | 下一頁
sqlite_busy_timeout | 上一層 | sqlite_close