|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
paginating help
alright, well I don't think this is what most people do but it seems like a valid solution to me. I have decided to simply pass three variables (so far), two fro looking bewteen two userids, and one for how many to add and subtract from the userids for the next and last links. My question is this: is it possible (I'm guessing using count works for this, although I am fairly unfamiliar with that still)... well is it possible to see how many users I have, and then only pass a varialbe to that point in the userids... ie, if I have 15 users, I want to be able to go through 1-10 first, and then just 11-15, and not have the next link show up... I am able to get the last link to go easily by seeing if the number is less than or equal to 1. And can I use this to make links to pages where the numbers are set, ie jump to page 1, it has nums 1-10, page 2 nums 11-20, etc. Here is the code I'm useing.
PHP Code:
That's all the stuff used for this problem of it. So any ideas? You guys help so mcuh thank you.
__________________
hey it's the CHARKING Last edited by thecharking : July 4th, 2003 at 07:04 PM. |
|
#2
|
|||
|
|||
|
little help? ... heh
Does anyone have any ideas? This is something I could use on numourous pages. So far it seems like a good idea. So how can I get the next link to work right, and display the number of pages along with it? BTW I did read the tutorial on pagination, but, I jsut want something simpler... it was hard to understand, so i wasn't able to change it everytime I wanted to change a few things
|
|
#3
|
|||
|
|||
|
It's not complete, but I hope this gives you some ideas.
PHP Code:
What you do with this is display the $results, then make previous & next links according to whether $next or $prev are set. HTH. |
|
#4
|
|||
|
|||
|
thank you
thanks for the help. I am still having problems though. It is working alright, except that it only displays five of my users. I have six in my db. It should show up to ten per page right? And when I click on the next link, it gives me this:
Warning: Unable to jump to row 0 on MySQL result index 38 in c:\phpdev\www\prp\jumpto.php on line 58 -- Prev -- Next here is 55-59: PHP Code:
I dont know what that means... thank you for all your help though oh and when you set num_rows, you let me set it up... but I set it up wrong I think, I was unsure of what to do, I used PHP Code:
but that seems to easy. I would post code, if you need it, but it's basically all the same as before. Any help would be greatly appreciated, and I hope I'm not missing something simple. Last edited by thecharking : July 10th, 2003 at 04:22 AM. |
|
#5
|
|||
|
|||
|
Too hard to guess what's going on. The code please...
One thing that I do see is that your $num_rows is a result resource, and not an integer. You will want to get the count from the result: PHP Code:
Last edited by avit : July 10th, 2003 at 04:58 AM. |
|
#6
|
|||
|
|||
|
thanks a lot
yah that was the main problem and i fixed a few other things and it works great now. you are awesome. I will be back probably when I decide to try to modify it or something, but I'm gonna screw around with this for a bit. Thanks so much!
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > paginating help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|