Foreach Loop and Pagination (3 posts)

  1. thesnowjunkies
    Posted 4 years ago #

    Can't get pagination to work with my custom database query because I don't fully understand custom database queries. All I know is that the code works well. I just can't figure out paging.

    Here's a sample page:
    US Music Festival Guide

    Here's the code:

  2. zimmi88
    Posted 4 years ago #

    Hmmm.... it looks like your query has a LIMIT 20 included... is that working ok? (Dunno if you're running the code you provided on production or not.)

    You could expand the LIMIT parameter to include a starting point. See here for more details. If that's working, then you'd probably want to use a get parameter (?page=x) for paging. Take the get parameter, multiply by number of items per page, and you have the starting record for your LIMIT query.

    I hope this helps!

  3. thesnowjunkies
    Posted 3 years ago #

    This does help, but the get parameter might be too complicated for me to figure out. Don't suppose anyone can point me towards some sample code?

Topic Closed

This topic has been closed to new replies.

About this Topic