Trouble With Pagination (Mysql)

hello,

I’m having a bit of trouble with pagination. I’ve got a query like this.

SELECT `username`, `body`, `threadToken`, `token` FROM `thread_replies_36933753` WHERE `threadToken` = :threadToken LIMIT :limit, :offset

From reading articles LIMIT is the first number, and offset is the second.

I keep getting empty results. I only get results with values 0,[number]

Does this mean that I need to switch the place of limit and offset? I know it’s a dumb question, just don’t understand why w3schools says the order is the other way.

That’s a MySQL query so the syntax should be

https://dev.mysql.com/doc/refman/5.7/en/select.html

[LIMIT {[offset,] row_count | row_count OFFSET offset}]

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.