PS, also, I would need to know and handle the beginning and end of that
array, ie, if there isn't a next or previous, I wouldn't want to display
a next or forward button, or maybe disable it...
On Tue, 2002-10-29 at 14:06, Petre Agenbag wrote:
> I need to do the following, and have a slight idea of how to do it, but
> I'm not sure...
> I want to do a "select id from table where something = "whatever" ",
> then I will display all the "hits" from that query as links to a
> "display" page, sending along the id's of the row.
> On that next page, I will use that id to retrieve the relevant data to
> display for that specific record, but, I want to have a previous|next
> function, that will display the relevant data of the previous or next
> record as was displayed on the original page that showed the list of
> "hits". So I *think* I should create an array containing all the id's of
> that query, and send it along with the clickthrough to the "display"
> page and then from there use the array functions "next" and "prev" to
> get the id's directly adjacent to the one I currently have, but I'm not
> sure if this is the best way to do it, for one, I don't know how to put
> those id's into an array from the original query, and two, don't know
> how to tell it to "get prev of current id from array" or "get next of
> current id from array". And I think it might be a bit of an unnecessary
> overhead to send that entire array via GET to the display page if you
> are only ever going to use 2 values from it, so It would make much more
> sense to me to pass the current id, the next id and the previous id for
> each "hit" along to the "display" page.
> Any ideas on how I could do that?
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php