123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|392|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> Web Development -> php and bf3stats.com api

Posted : Tuesday, 13 March 2012, 08:27
waroffice
Afternoon,

I would like to code something that returns 2 lines of data for an lcd screen i have, i have the lcd working fine but what I need is to be able save the data and only poll the website API after a set time out period, 5 mins for example.

What I need is a nice way to store the data and a way to check the last time.

bear in mind that this will rarely be accessed via a browser so cookies won't work.

I guess i could use mysql? or a file?

I was hoping for something nice and simple like me.

cheers

Dean
Posted : Tuesday, 13 March 2012, 08:36
JL235
I would just use a file. Dirt simple, and dirt cheap.

If it's just one script, in relation to one expected request, then it will be fine. If it's part of something more complex, then you could have multiple files (each for each LCD screen), and I normally have a 'dynamic' folder where I store all this stuff.

If it's more complicated then that, then use a DB.

I have not tested this code, but this is kinda what I would use for the file time management if I were building this.

It returns either the file time or the current time (depending on if it exists), and also updates the file to the current time.

-=-=-
PlayMyCode.com - build and play in your browser, Blog, Twitter.
Posted : Wednesday, 14 March 2012, 10:41
waroffice
awesome.

just what I was looking for.

Thanks