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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Paginating Search results in PHP

  • 16-07-2008 1:07pm
    #1
    Registered Users, Registered Users 2 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, Registered Users 2 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