Results 1 to 7 of 7
Thread: Need Idea for "next item"
Apr 21, 2009, 02:06 #1
Need Idea for "next item"
Suppose our database has items with id
1 2 4 18 25 67 (may be between records were deleted for some reasons)
now when item 18 is being displayed....there should be next item button which should point to 25....then 25 to 67 and so on....in 67 the next item button should not be there (means may be dimmed)
so what is best and efficient way of doing it...
best i can think of for now,may be
select min(id) from table where id>current_id (for next)
select max(id) from table where id<current(for previous)
how resource friendly is it?
and any other better way than this...
Apr 21, 2009, 02:54 #2
Do a search for "pagination" here or on google. There's a lot of info and examples. The fact that you show only one item at a time is not important, it's still pagination
Apr 21, 2009, 02:56 #3
Try Improvely, your online marketing dashboard.
- Join Date
- Aug 2000
- Philadephia, PA
- 1 Post(s)
- 0 Thread(s)
→ Conversion tracking, click fraud detection, A/B testing and more
Apr 21, 2009, 03:37 #4
read question first before answering ....u wont be getting prize for number of posts
more over i am talking about more advanced performance here..... how would MAX and MIN functions effect things if there were millions of records....?
any way thanks "Dan Grossman" ...ya they are primary id....
up to now it has been ok ...lets see if any body has better idea...
Apr 21, 2009, 03:45 #5
Apr 21, 2009, 04:19 #6
so i was just trying to make sure that the paging u r referring (with blind google search suggestion) and this one is different....
it is to be understood from the question......
The normal paging may have start ...how many rows to show ....and so on...
where is this is pratically different....
any way i dont have any thing to say about last line other than "never mind"
Apr 21, 2009, 04:21 #7
- Join Date
- Jul 2002
- Toronto, Canada
- 63 Post(s)
- 3 Thread(s)