I have a table that displays 10 rows per page. Now, given an item’s ID, how can I get the “page” that the item is on?
In other words, I’m looking for the offset (multiple of 10) given an ID of a record.
SELECT * FROM items
WHERE category = "category"
LIMIT ?, 10 <----- TRYING TO FIGURE OUT HOW TO GET ? OFFSET GIVEN ID
ORDER BY id DESC
Try this: