Is there a way to make a script that does this:
Find all records with $Currentstat less than $Max...
Then with all records found with that... add X amount on to "Current field" ?
But this script needs to run on its own as i will be using it as a Cron so even if no one is logged in it should still work.
And if $CurrentStat is equal to Max then do nothing?
Update all records with this "field"[Topic Solved]
Moderator: General Moderators
Update all records with this "field"[Topic Solved]
Last edited by SirChick on Sun Oct 14, 2007 5:18 pm, edited 1 time in total.
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Code: Select all
$sql = "UPDATE mytable SET Current_field=Current_field+$X WHERE Currentstat<$Max";(#10850)
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA