Jump to content

Recommended Posts

I have a php database search engine that works great, only thing is all results display on one page. I'm trying to figure out a simple handling for breaking it down 20 results to a page without passing the db query results from page to page. Is there a way to formulate a sql query so it gives me the first 20 results, then the next 20 results, etc.? Or is there some other simple method. the only options I'm looking at right now are:

1. re-execute the sql query on each page and only display the results desired (i.e. if you want results 21 - 40 loop through the first 20 but don't display them...

OR

2. Save all results in an array and pass it page to page and display the desired results from that array.

 

I can't help but think there is a simpler method.

Any ideas?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.