Page 1 of 1

Number to increase automatically

Posted: Fri Jan 09, 2009 5:44 pm
by Aki
I'm relatively new to PHP and MySQL, and I want to write a code which updates a certain value by adding one each hour or day or something. Could anyone help me?

Re: Number to increase automatically

Posted: Fri Jan 09, 2009 5:59 pm
by it2051229
yes it is possible, you can base that incrementing of value from the computer's system time.

Re: Number to increase automatically

Posted: Fri Jan 09, 2009 6:03 pm
by Aki
it2051229 wrote:yes it is possible, you can base that incrementing of value from the computer's system time.
Wouldn't that mean a user could increase this value by simply adjusting the clock on his computer?

Re: Number to increase automatically

Posted: Fri Jan 09, 2009 7:43 pm
by it2051229
I'm relatively new to PHP and MySQL, and I want to write a code which updates a certain value by adding one each hour or day or something
you never mentioned THAT it interacts with user. now i'm confused

Re: Number to increase automatically

Posted: Fri Jan 09, 2009 8:32 pm
by Aki
it2051229 wrote:you never mentioned THAT it interacts with user. now i'm confused
sorry, I'll explain it further.

What I'm trying to do is to write a script which will increase the value for the users constantly, say by 1 per hour or something. And I might be wrong but if it's set after the different users' computer watches, wouldn't that make it easy to "cheat" having the value increase more than it's supposed to, by adjusting the time?

Re: Number to increase automatically

Posted: Sat Jan 10, 2009 6:39 pm
by it2051229
i'm talking about the "server" time, not the client's computer time so they can't cheat unless someone(e.g. you) has access to the server computer and do it.