Tag Archives: sqlite

Counting Rows Returned by an SQLite3 Query in PHP

Tested with PHP 5.3.1

Strangely, when running queries against an SQLite3 database, there is no obvious way to know how many rows were returned by a specific query. After much hunting, I found a solution in the PHP manual, of all places.

Let’s say we have a table with 4 columns (id, seed, name, score), with 3 rows. The rest you need to know is in the code comments, really. Read more »