Tonka Posted August 24, 2008 Posted August 24, 2008 i was wondering if any has had success with not giving bank interest to anyone that has been offline for a certain number of days, i have tried a few times but it didn't work here's what i have $db->query("UPDATE users SET bankmoney=bankmoney+(bankmoney/50) where bankmoney > 0 AND laston < (unix_timestamp() - 259200)") or die(mysql_error()); $db->query("UPDATE users SET cybermoney=cybermoney+(cybermoney/100*4) where cybermoney > 0 AND laston < (unix_timestamp() - 259200)") or die(mysql_error()); i'm not getting any error output at all and no one is getting any interest at all Quote
Floydian Posted August 27, 2008 Posted August 27, 2008 Re: Bank Interest I'd suggest getting rid of the "or die..." part. Sure, it's possible the query might fail, but do you really want the rest of your cron to not execute? Seems drastic to me. $db->query("UPDATE users SET bankmoney=bankmoney+(bankmoney/50) where bankmoney > 0 AND laston > unix_timestamp() - 60*60*24") or die(mysql_error()); Note the change of less than to greater than after last on. Quote
Tonka Posted August 27, 2008 Author Posted August 27, 2008 Re: Bank Interest Thx Floydian, it worked perfectly Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.