How to get query to transfer to subsquent pages when paginating results

前端 未结 2 1483
北恋
北恋 2021-01-25 00:03

I\'ve been going through all the pagination questions and answers on the site, and among all the long-drawn out code and OO solutions, this code is among the shortest and simple

2条回答
  •  無奈伤痛
    2021-01-25 00:43

    I think you have to use the OFFSET token in your query. Like so:

    $query = "SELECT * FROM table ORDER BY title LIMIT $perPage OFFSET $perPage * $page"; 
    

    I hope this helps.

提交回复
热议问题