no no no!! There is no need to use PHP for this, mySQL can do this for you (it'll be faster too). mySQL has a handy little parameter for such functions as SELECT, called LIMIT.
Basically, this parameter tell mySQL to limit the result set to a certain record range. So for you're example you want 7 results per page, so we add this to the end of the SQL statement This will give us the first 7 results (the second argument in the parameter) starting from the first record (which will always be 0).
But what if you want to show the next page?? Well that's pretty simple, all we have to do is supply an "offset" variable in the query string, so we've gone through the first 7 records right? We need the next 7, so our offset is going to be 8 (because the first record was 0, think bout it  ). Thus our statement will be This will give us 7 results, starting (and including) from the 8th record.
__________________
A lie gets halfway around the world before the truth has a chance to get its pants on. - Sir Winston Churchill
Please visit my sites: Please login or register to view this content. Registration is FREE | Please login or register to view this content. Registration is FREE
|