|
Posted by Bob Stearns on 12/16/54 11:59
comp.lang.php wrote:
> 'll try to explain this as clearly as possible, sorry if it's unclear.
>
> 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
>
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.
[Back to original message]
|