I don't quite understand what you're trying to achieve. You said if it returns 1-5 rows, only display 1. So why bother with the other 4 rows? Or 6-10 rows only display 2 rows. Again, why even bother with retrieving that many rows?
EDIT: Are you trying to display up to 5 rows at a time? If that's the case, then utilize the LIMIT clause on your query. Every time you want to view the next 5 rows, you'll have to recall your query, but this time the values used in the LIMIT clause will be different, retrieving different records.
If that's not what you're looking for then I really don't know.