Temporary storage for database request
Posted 06 October 2005 - 07:41 PM
I'm having a little problem here dealing with a MySQL database, but this question is not about MySQL, so I posted it here.
What I'm trying to do is keep a database request in a temporary storage place (if it can be done) so that I can use the data put there while the user surfs the web site.
O.K. To be a bit more understandable, let's put it that way:
The user has several choices, and when the user clicks on one, a request is made to the database and the data is put in an array (sometimes big arrays). I would like this array to be kept, so the user can continue browsing and does not need to reload it all the time he needs to access to it, let's say, when he turns the pages of the contents or when he decides to come back to its initial choice.
If you have any questions, let me know.
Thanks for your help!
Posted 06 October 2005 - 07:45 PM
Posted 06 October 2005 - 07:47 PM
Let's say I receive 100 results from the database with my query. I put 10 results per page. What should I do so that I do not need to reload the same query all the time and only show 10 of the 100 results given everytime?
I was thinking of putting it in an array, and save this array, so that the user can "turn" the pages and would not query the database anymore.
But I could get results like a year's registry of a company phone calls, so I think cookies would not do it, would they?
Posted 06 October 2005 - 07:50 PM
Yes, that's what I was thinking about. I should create a new table in my database instead of cookies?
Posted 06 October 2005 - 08:13 PM
or you can put the array into SESSION
or [php] * 1000... PLEASE READ THE POSTED SOLUTIONS CAREFULLY * 1000000...
Posted 06 October 2005 - 08:38 PM
Your answer is what I was looking for.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users