Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #18413

Php/Mysql paginate results without resubmitting query

From cb <cb@ppt.io.it>
Newsgroups comp.lang.php
Subject Php/Mysql paginate results without resubmitting query
Date 2020-11-19 17:43 +0100
Organization Aioe.org NNTP Server
Message-ID <rp67bt$up2$1@gioia.aioe.org> (permalink)

Show all headers | View raw


Please be patients !
I'm doing a big (sort of) select:
SELECT column1,column2 FROM table ORDER BY column1 LIMIT $count OFFSET 
$offset;
(Without the LIMIT the select fails for exceeding time limit or whatelse.)
The user is then allowed to "page down" for getting next $count rows.
It works, BUT the query is re-submitted scanning again the whole DB.

Is there a way to store the RESULTS of the original query, and then 
"paginate" into it (into the stored results) not into the DB?

Googling around I've found (and I'm doing it!)
    $rc = mysqli_query($db, $qlib);
    while ($row = mysqli_fetch_array($rc)) {
       array_push($righe, $row);
    }
BUT if $qlib has no LIMIT it abend for exceeding limits.

THANK YOU !

Back to comp.lang.php | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Php/Mysql paginate results without resubmitting query cb <cb@ppt.io.it> - 2020-11-19 17:43 +0100
  Re: Php/Mysql paginate results without resubmitting query Jerry Stuckle <jstucklex@attglobal.net> - 2020-11-19 15:05 -0500
    Re: Php/Mysql paginate results without resubmitting query cb <cb@ppt.io.it> - 2020-11-21 18:03 +0100
  Re: Php/Mysql paginate results without resubmitting query "J.O. Aho" <user@example.net> - 2020-11-19 22:54 +0100
    Re: Php/Mysql paginate results without resubmitting query cb <cb@ppt.io.it> - 2020-11-20 08:36 +0100
      Re: Php/Mysql paginate results without resubmitting query cb <cb@ppt.io.it> - 2020-11-20 08:45 +0100
        Re: Php/Mysql paginate results without resubmitting query cb <cb@ppt.io.it> - 2020-11-20 08:53 +0100
      Re: Php/Mysql paginate results without resubmitting query "J.O. Aho" <user@example.net> - 2020-11-20 10:15 +0100
        Re: Php/Mysql paginate results without resubmitting query cb <cb@ppt.io.it> - 2020-11-20 11:30 +0100
        Re: Php/Mysql paginate results without resubmitting query Jerry Stuckle <jstucklex@attglobal.net> - 2020-11-20 11:05 -0500
  Re: Php/Mysql paginate results without resubmitting query Arno Welzel <usenet@arnowelzel.de> - 2020-11-20 17:42 +0100

csiph-web