Q:

how can I determine the number of affected rows in a SQLite 2 query in PHP

I'm writing an application in PHP 5. I want to delete some rows in a SQLite v2 database file. I'm doing something like this:
$sqliteConnection = new SQLiteDatabase('path/to/db');
$queryString = "DELETE FROM myTable WHERE status='not good'";
$result = $sqliteConnection->query($queryString);

how can I know how many rows were affected by this query? how many rows have I deleted?

A:

The PHP function sqlite_changes() does this for you. 

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

Call it either in procedural-style:
echo 'Number of rows modified: ', sqlite_changes($sqliteConnection);

or in object-style:
echo 'Number of rows modified: ', $sqliteConnection->changes();

