Tonka Posted August 24, 2008 Share 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 Link to comment Share on other sites More sharing options...
Tonka Posted August 27, 2008 Author Share Posted August 27, 2008 Re: Bank Interest anyone know how? Quote Link to comment Share on other sites More sharing options...
Floydian Posted August 27, 2008 Share 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 Link to comment Share on other sites More sharing options...
Tonka Posted August 27, 2008 Author Share Posted August 27, 2008 Re: Bank Interest Thx Floydian, it worked perfectly Quote Link to comment Share on other sites More sharing options...
Floydian Posted August 27, 2008 Share Posted August 27, 2008 Re: Bank Interest You're welcome ;) Quote Link to comment Share on other sites More sharing options...
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.