Then I understand it much better. You can count the number of rows with COUNT in SQL:
SELECT COUNT(id) AS c FROM...
Or you can retrieve all the rows and then use the PHP command mysql_num_rows($result). I think that the easiest way is to do the math here and then get the correct rows. If you do it this way you should use the COUNT function in SQL.
When choosing what to display you can use the LIMIT function in SQL:
SELECT id FROM table LIMIT 0, 6 will return the first 6 rows
SELECT id FROM table LIMIT 6, 6 will return 6 rows starting from the seventh row.
And you should use ORDER BY to get the result in the correct order. You can order either ASCending or DESCending.
SELECT id FROM table ORDER BY date ASC LIMIT 0, 6