PHP/sqlite3 rowcount question
#1

Hello there,
I know this is not really pawn. But it is pawn related.
I am creating a user control panel and i want to list reports on the website for admins.
This code works perfect but i have trouble with page navigation.
If i use the same way as in samp like count++ it always returns 1.

How do i succesfully count rows? because numrows and sqlite_num_rows dont work.

PHP код:
$record_index= ($page-1) * $limit;  
 
$sql "SELECT * FROM REPORTS LIMIT $record_index$limit"
 
 
$stmt $db->query($sql);
 while(
$row $stmt->fetchArray(SQLITE3_ASSOC) )
 {
        
$countrows $stmt->numRows(); // error 
I did try to follow these :
http://php.net/manual/en/function.sqlite-num-rows.php

But this always result into a fatal error
Код:
Fatal error: Call to undefined method SQLite3Result::numRows() in D:\AppServ\www\ucp\reports.php on
Any help would be appreciated
Reply


Messages In This Thread
PHP/sqlite3 rowcount question - by jasperschellekens - 24.02.2018, 11:17
Re: PHP/sqlite3 rowcount question - by jasperschellekens - 24.02.2018, 11:34
Re: PHP/sqlite3 rowcount question - by kingmk - 24.02.2018, 11:41
Re: PHP/sqlite3 rowcount question - by jasperschellekens - 24.02.2018, 11:56
Re: PHP/sqlite3 rowcount question - by jasperschellekens - 24.02.2018, 12:56

Forum Jump:


Users browsing this thread: 2 Guest(s)