Record Navigation - PHP/MySQL

Associate
Joined
1 May 2006
Posts
810
Location
Bristol, UK
Seems I'm about quite a bit now, the plague of the H,G&P forum :p
Oh well, this is what happens when I try to learn things :p

Using Dreamweaver I was always able to create record navigation bars (first, last, next & previous) and repeating regions.
In line with My Thread last night I've decided to remove Dreamweavers bloated auto-code from the website I had started 5 hours before and hand code it all instead. However, I've got so far and now I'm stumped.

The Problem:
I have a recordset (containing blog posts) that, depending on how often I update it, will have a lot of records.
I'm trying to limit this number to 5 per "page" and use the aforementioned nav buttons to switch between "pages".
I literally have NO idea where to start. ANYTHING would be helpful at this point.

Thanks a bundle guys.
 
Basically you use your SQL to LIMIT the number of records returned.

Can't remember the syntax for limit at the mo but it enables you top just return any part of what a normal query would do so you could get the middle 10 records if you wanted just by specifying where to start and how many to return.

I normally do the query I want to return the number of records then work out the number of pages etc so I know what to pass to the LIMIT part of the query when I navigate around pages. Always passing the page number and number of records on the query string :)

Hope that helps a bit.
 
Cheers probedb

I did some research on the LIMIT function and somehow it just worked :p
Going to have a play with some variables.

Thanks for the clue-in :)
 
Back
Top Bottom