best option for carrying data across between refreshes?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
IGGt
Forum Contributor
Posts: 173
Joined: Thu Nov 26, 2009 9:22 am

best option for carrying data across between refreshes?

Post by IGGt »

hi Guys,

I'm setting up what should (hopefully) be quite a straight forward page that checks in the database and records the delay between xTime and yTime. That part has been completed and works well.

However I now want to set up a system whereby I display the last 10 results. I am thinking the best way to do it is to set up a variable that I can POST each time (as the page will automatically refresh every 60 seconds). What I'm wondering though is whether it would be better to set up 10 variables and post each of them, then start each page with set $10 = $9, $9 = $8 etc., or if it would be better to create an array, and POST the array, then reset the array using a similar process as before ($netArray['10'] = $netArray['9'] etc.)

What would people consider to be the best solution?
curlybracket
Forum Commoner
Posts: 59
Joined: Mon Nov 29, 2010 2:40 pm

Re: best option for carrying data across between refreshes?

Post by curlybracket »

I think there are two better solutions than Yours. First: use sessions to store data between refreshes. Second, if you use MySQL to this project anyway: keep Your last ten results in MySQL table. For me session sounds better for this simple task.
Post Reply