Pagination keeps showing the same portion of SQL data

前端 未结 3 1860
长情又很酷
长情又很酷 2021-01-29 05:46

I have a really large data set from SQL that i need to paginate.

I have an issue with my pagination code. The code does show the page number in the URL

3条回答
  •  闹比i
    闹比i (楼主)
    2021-01-29 06:16

    Try:

    $sql='SELECT * FROM ETF LIMIT ' . $results_per_page . ' OFFSET ' . $this_page_first_result;
    

    Also as mentioned you should sort by a certain column with 'ORDER BY' for consistent results.

提交回复
热议问题