Pagnation without mySQL, is it possible.
Moderator: General Moderators
- akimm
- Forum Contributor
- Posts: 460
- Joined: Thu Apr 27, 2006 10:50 am
- Location: Ypsilanti Michigan, formally Clipsburgh
Pagnation without mySQL, is it possible.
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.
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
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
- akimm
- Forum Contributor
- Posts: 460
- Joined: Thu Apr 27, 2006 10:50 am
- Location: Ypsilanti Michigan, formally Clipsburgh
Volka, if I understand you correcty
then something like
I know thats not the correct code, but is it at least along the same line?
Code: Select all
$pagnation = array(
element[0],
element[1],
et cetera.....
..........
........
);Code: Select all
print_r(count($pagnation(elements[0],elements[9])))http://www.timvw.be/pagination-for-all/ but we've got like a zillion of threads about the topic on this forum too...
Also check this out!
Ah.. Here's how my proped solution would handle globbing 
Code: Select all
$pageabledata = new PageableArray(glob('*.jpg'));- Ollie Saunders
- DevNet Master
- Posts: 3179
- Joined: Tue May 24, 2005 6:01 pm
- Location: UK
Code: Select all
array_slice()