ConFoo Montreal 2017 Calling for Papers


(PHP 5 < 5.4.0, PECL sqlite >= 1.0.0)

sqlite_has_moreFinds whether or not more rows are available


bool sqlite_has_more ( resource $result )

Finds whether more rows are available from the given result set.



The SQLite result resource.

Return Values

Returns TRUE if there are more rows available from the result handle, or FALSE otherwise.

See Also

  • sqlite_num_rows() - Returns the number of rows in a buffered result set
  • sqlite_changes() - Returns the number of rows that were changed by the most recent SQL statement

add a note add a note

User Contributed Notes 2 notes

dragosmocrii at gmail dot com
8 years ago
I use this function to check if an element exists in the database.

$db=sqlite_open('./sqlite_database.db',0666,$err) or die();
$query='select * from catsub where cat=\''.$cat.'\'';
$result===true ) echo 'Exists'; else echo 'Doesnt Exist';
dcchut at gmail dot com
7 years ago
dragosmocrii at gmail dot com:

It is slightly more efficient to use the COUNT function. (And when I say slightly I mean whisker small slightly.)

// $db is a SQLite database connection

if (sqlite_single_query($db, 'SELECT COUNT(*) FROM records WHERE amount_owing > 500')) {
// There are records where the amount owing exceeds $500, do some action.
} else {
// No money for you!

To Top