jeremiorama Posted October 6, 2005 Share Posted October 6, 2005 Hi there! 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! -jeremiorama Quote Link to comment Share on other sites More sharing options...
craygo Posted October 6, 2005 Share Posted October 6, 2005 you can store the arrays in a temporary table which should stay active as long as the person does not close the browser or you close the mysql connection in your code. Quote Link to comment Share on other sites More sharing options...
jeremiorama Posted October 6, 2005 Author Share Posted October 6, 2005 Ok, just some more questions. I know this forum is about PHP but since MySQL is it's most used database, then i'll just ask, if anyone knows. 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? Thanks, -jeremiorama Quote Link to comment Share on other sites More sharing options...
jeremiorama Posted October 6, 2005 Author Share Posted October 6, 2005 Hey craygo, Yes, that's what I was thinking about. I should create a new table in my database instead of cookies? Thanks, -jeremiorama Quote Link to comment Share on other sites More sharing options...
ryanlwh Posted October 6, 2005 Share Posted October 6, 2005 you can CREATE TEMPORARY TABLE. or you can put the array into SESSION Quote Link to comment Share on other sites More sharing options...
jeremiorama Posted October 6, 2005 Author Share Posted October 6, 2005 Hey thanks ryanlwh! Your answer is what I was looking for. -jeremiorama Quote Link to comment Share on other sites More sharing options...
neylitalo Posted October 7, 2005 Share Posted October 7, 2005 Please take care to post in the correct forum - read the descriptions of each board below the board's title. I've moved this one to MySQL Help. Thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.