Home  >  Q&A  >  body text

Pagination, can the data array queried using SQL statements be paginated? $list=query($sql); It seems that the paginate() method cannot be used

Can the data array queried using SQL statements be paginated? $list=query($sql); It seems that the paginate() method cannot be used

带砖侍卫带砖侍卫2372 days ago1532

reply all(5)I'll reply

  •  

     2018-03-27 10:38:33

    You can use limit

    when querying.

    reply
    1
  • 海塞尔维亚

    There are two types of paging, one is paging when querying data with mysql, and the other is paging of data queried by sql statement. Is LZ asking about the latter?

    海塞尔维亚 · 2018-03-27 11:16:22
    带砖侍卫

    It is the data queried using sql statement, which is an array.

    带砖侍卫 · 2018-03-27 16:36:10
    带砖侍卫

    Oh, I'll try, thank you

    带砖侍卫 · 2018-03-27 16:36:30
     

    If LZ wants to paginate the queried array, just convert the array to JSON.

      · 2018-03-27 17:14:56
  • Cancelreply