Jump to content
MakeWebGames

Bank Interest


Tonka
 Share

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...