Search code examples
phpmysqljoomla2.5

Get certain amount of rows after the first 3 php mysql


Hi Im trying to get certain amount of rows after the first 3 rows like for example:

this is the rows in the database

-id

  • 20
  • 19
  • 18
  • 17
  • 16
  • 15

When i select * from #__table where published=1 order by id desc limit 0,3

i get

20 19 18

as result.

Now what i want to do is create a query where i can get the next ones after the first 3 rows

17 16 15


Solution

  • Try to increase your limit with 3

    SELECT *
    FROM #__TABLE
    WHERE published=1
    ORDER BY id DESC LIMIT 0,3
    
    Then LIMIT 3,3
    Next LIMIT 6,3