Page 1 of 1

Pagnation without mySQL, is it possible.

Posted: Mon Oct 09, 2006 1:03 pm
by akimm
For instance, I assume with something like count() you could count the output of an array and pipe the excess to another page maybe? Not quite sure but I'd imagine its possible.

Posted: Mon Oct 09, 2006 1:19 pm
by volka
You need your elements to be countable, this is the first element, this is the second element ... tis is the nth element.
Just like mysql records are because of the primary index or an ORDER BY statement.
Now you print m elements (e.g. 10) per page -> first page:elements 0 to 9, second page: elements 10 to 19, nth page: elements n*10 to (n+1)*10-1

Posted: Mon Oct 09, 2006 1:24 pm
by akimm
Volka, if I understand you correcty

Code: Select all

$pagnation = array(
element[0],
element[1],
et cetera.....
..........
........
);
then something like

Code: Select all

print_r(count($pagnation(elements[0],elements[9])))
I know thats not the correct code, but is it at least along the same line?

Posted: Mon Oct 09, 2006 1:26 pm
by timvw
http://www.timvw.be/pagination-for-all/ but we've got like a zillion of threads about the topic on this forum too...

Posted: Mon Oct 09, 2006 1:28 pm
by akimm
Thanks, I'll check that out.

Posted: Mon Oct 09, 2006 3:11 pm
by bokehman

Posted: Mon Oct 09, 2006 4:39 pm
by timvw
Ah.. Here's how my proped solution would handle globbing ;)

Code: Select all

$pageabledata = new PageableArray(glob('*.jpg'));

Posted: Mon Oct 09, 2006 6:11 pm
by akimm
Thanks Bokehman, I will also check that out. Thanks much.

Posted: Mon Oct 09, 2006 6:12 pm
by Ollie Saunders

Code: Select all

array_slice()

Posted: Mon Oct 09, 2006 6:56 pm
by akimm
Thanks i will look into all of these options.