Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Paginating Search results in PHP

Options
  • 16-07-2008 2:07pm
    #1
    Registered Users Posts: 379 ✭✭


    Looking for some advice.

    I have a freetext search box which is submitted and returns results. At the moment I have it paginating etc. but its a bit messy.

    Is anyone aware of any PHP script or tutorial that gives a good example of it.

    Or has anyone any advise - At the moment Im session registering the results and on each subsequent page displaying a subset of this array.

    Would it be better to query the DB each time using an offset and limit, instead of this method


Comments

  • Registered Users Posts: 3,594 ✭✭✭forbairt


    Would it be better to query the DB each time using an offset and limit, instead of this method

    yes ? what are you going to do when you've got 2000 results .. store them all in session data ? 20,000 ...


  • Closed Accounts Posts: 8,866 ✭✭✭Adam


    Yep, limit and offset your query.


Advertisement