What is the best way to select a given number of rows starting at a given row number, looping to the beginning of the table if necessary?
The following does not work if the sum of
$limit is greater than the number of rows in the table:
SELECT * FROM table ORDER BY sort_order ASC LIMIT $starting_offset, $limit
I need to always select
$limit number of rows.