I'm trying to make the code I use to retrieve visitor comments more efficient. At present, I move all comments for the current 'page name' to an array, and then, depending on the 'page number', select the applicable range and display.
Is there a way to select a range of records from a database without reading them all in first and filtering with PHP?
...My site displays 15 comments per page
...68 comments for the current 'page name'
...visitor is on page 3
1 - 15 = page 1
16 - 30 = page 2
31 - 45 = page 3 <- just get these
46 - 60 = page 4
61 - 68 = page 5