Complicated pagination logic problem



'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

.



Relevant Pages

  • Re: Complicated pagination logic problem
    ... You have in your database metadata for 30 out of those 42 images ... variable's value to select which part of the array to display. ...
    (comp.lang.php)
  • Re: Complicated pagination logic problem
    ... You have in your database metadata for 30 out of those 42 images ... If any of the 42 images have metadata, you must display the metadata, ...
    (comp.lang.php)
  • Re: command-line utility to write/edit iptc info?
    ... does anyone know of a good utility to write and edit iptc metadata from ... print the EXIF metadata of JPEG images as summary info, ... extract EXIF metadata, IPTC metadata and JPEG comments from ...
    (Debian-User)
  • Re: command-line utility to write/edit iptc info?
    ... does anyone know of a good utility to write and edit iptc metadata from ... print the EXIF metadata of JPEG images as summary info, ... extract EXIF metadata, IPTC metadata and JPEG comments from ...
    (Debian-User)
  • Re: silent semantic changes with reiser4
    ... But having it in the kernel has the same problem. ... Ignoring samba for a bit which just needs streams to stay compatible ... images with thumbnails and exif data, ... * standard way to add common metadata to a file which can be used for ...
    (Linux-Kernel)