Re: Complicated pagination logic problem
- From: Bob Stearns <rstearns1241@xxxxxxxxxxx>
- Date: Thu, 28 Sep 2006 16:52:34 -0400
comp.lang.php wrote:
'll try to explain this as clearly as possible, sorry if it's unclear.Just put a hidden variable with the next picture to start with on your form. Then after merging the arrays (it might be better to start with an array of filenames not the pictures themselves) use the hidden variable's value to select which part of the array to display.
You have in your directory /foo 42 images
You have in your database metadata for 30 out of those 42 images
You have to display all 42 images in the /foo directory whether they
have database metadata or not.
If any of the 42 images have metadata, you must display the metadata,
else, you don't.
With me so far? Good, it gets wild from here.
You have a requirement for pagination.
Your pagination limit is to only show 20 images at a time.
The only way I know how to do this is to get all of the images out of
the filesystem pertaining to /foo, all of the metadata out of the
database pertaining to /foo, and logically combine them (using
array_merge()) into a single resultset and display, metadata or not.
However, to paginate to the next page, you'll have to have had stuffed
THE ENTIRE RESULTSET into a $_SESSION variable and splice that.
That of course is not good. But what on earth else do I do? If I am not
to use $_SESSION, how would I paginate such an exotic resultset?
Thanx
Phil
.
- References:
- Complicated pagination logic problem
- From: comp.lang.php
- Complicated pagination logic problem
- Prev by Date: Re: New Window
- Next by Date: Russian characters in MySQL and phpMyAdmin
- Previous by thread: Complicated pagination logic problem
- Next by thread: Joys of CVS
- Index(es):
Relevant Pages
|