Increment Values

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
gfirman
Forum Commoner
Posts: 30
Joined: Tue Nov 21, 2006 10:41 am

Increment Values

Post by gfirman »

Hi,

I am trying to work out how to increment values in a field over a period of time. The problem is how to loop the statement which updates the values. The values need to be updated every 15 minutes. Does anyone know the easiest way to do this?
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

Schedule a task that gets executed every 15 minutes (using cron for example).

I would probably recommend AGAINST this practice though... In most situations it's better to keep track of the last modification data... and on retrieval of those values, apply the 'updates' based on the delta (now - last mod date)...
gfirman
Forum Commoner
Posts: 30
Joined: Tue Nov 21, 2006 10:41 am

Post by gfirman »

ok, thanks.....I'll look into that
Post Reply