|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Selecting next 10 rows in table?
Code:
$sql = "SELECT 1, 2, 3 FROM tbl1 ORDER BY 1 DESC LIMIT 0, 10"; So, I loop out the 10 last entrys from the database...nothing special so far. What I like to do is to make a link that will show the next 10 entrys. Any smart way of doing it? |
|
#2
|
|||
|
|||
|
wow... either a very tricky question or a very low activity here :P
![]() |
|
#3
|
||||
|
||||
|
I'm guessing it's pagination you're looking for? (to display results on different pages)
Perhaps Google will help you figure it out: php pagination As a quick tip... you may want to pass a variable to your results page indicating which page your on.. Example, if your URL was: http://www.example.com/results.php?page=2 PHP Code:
__________________
Daryl's Homepage | My Blogroll | My Profile | Firefox supporter! DevArticles Forum Moderator "The net is a waste of time, and that's exactly what's right about it." -- William Gibson |
|
#4
|
|||
|
|||
|
This is a snippet of what I finally came up with, since there finally was an answer in th thread I thought I post how I solved it.
PHP Code:
The above prints a row of page numbers...code might look a bit tacky I know...but it does the job and I might rewrite it later |
|
#5
|
||||
|
||||
|
Thanks for following up Laban!
Hopefully this helps others in your situation. |
|
#6
|
|||
|
|||
|
My pleasure MadCow...where's my rep points??
The code might have to be explained a bit more, will do so if required. |
|
#7
|
||||
|
||||
|
There's yer rep points! =P
Pagination is a common request here... Hopefully your code helps others |
|
#8
|
|||
|
|||
|
Pagination would be nice to master, perhaps there should be a article about it. I'll see if I can whack something together in more detail based on the above sample.
Thanks for the points :P |
![]() |
| Viewing: Dev Articles Community Forums > Databases > MySQL Development > Selecting next 10 rows in table? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|