I don’t know if this is the right place to ask such a question, pls suggest if not, i’ll post to the related forum.
I have an array() of models fetched from the db in single query, essentially inserted into an associative array based on some processing after fetching.
so you can assume that there are more that 50 model records in array().
So i have my array() completely populated before calling $this->render(‘view fille.php’, array(mydata);
Now i want to show these records one by one, one at a time, to the user.
How can i do that provided that I have already queried all records to show and next request from the user
should be satisfied from existed records populated at first place.
This functionality is indeed required to speed up the things how ever there is one more question i wanted to ask here.
and that is.
since i have multiple records/models arranged in sequence (fetched by query based on some condition) of same type and i want to show the user each at a time.
how to do this…?
How to achieve a link list kind of functionality
i.e i provide a "Next" button to the user to fetch the next record in the sequence
for example my query fetched me 10 models in a sequence which are numbered based on some primary key
22, 45, 56, 88, 99, 101, 111, 125, 222, 225
so rather than rendering all the models i render each one by one, so lets pic to start with
22,
I display model with 22 as primary key to the user and provide a "next" button on the view. user pressed "next" button and next model should be
with 45 as primary key along with a next button.
so my question is how to know what is the next record in the sequence
where should i store this information so that next record should be fetched from queried data collect at first time…?