I have a SELECT query, and I would like to know the number of rows.
I tried:
sqlite3_data_count(statement);
but it always returns 0
sqlite3_data_count is not counts row but counts columns.
sqlite3_data_count returns the number of values (columns) of the currently executing statement. With no results it returns 0.
LINK HERE
You can verify it in .h doc for sqlite3_data_count().
To count number of rows you can use following:
SELECT COUNT(*) FROM "mytable"