Jump to content
MakeWebGames

versus

Members
  • Posts

    5
  • Joined

  • Last visited

versus's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. I see you managed to confuse a number of people there. :) Long answer: no issue because both time() function in PHP and unix_timestamp() function in MySQL reference the same value: seconds since 00:00:00 UTC January 1, 1970 (disregarding leap seconds). Using unix_timestamp()+13*60*60 will be exactly 13 hours from now, regardless of what the local timezone is where you read that statement and regardless of the delta of your local timezones. Local timezone is a relative measure, POSIX time (or Unix time or Unix epoch) is absolute.
  2. Re: [mccode V2] Bank Investment   good thinking lol. i will take a look at the code and post an updated version. And maybe add a UPDATE users SET money=money-$amount WHERE userid=$userid   while you're add it. And also change this $result = $db->query("SELECT * FROM `investment` WHERE `user` = '".$userid."' AND `time` > '".time()."' AND `collected` = '0'");   to $result = $db->query("SELECT * FROM `investment` WHERE `user` = '".$userid."' AND `time` > '".time()."' AND `collected` = '1'");   Otherwise people will only ever be able to use the investment fund once and never again.
  3. Re: [V2] Libary   UPDATE userstats SET iq=iq+{$gain_here} WHERE userid={$userid};
  4. Re: Please Help With Mailbox!!! Funnily enough, I have seen a similar mistake done in a mod that was posted freely on these boards. Take a look at the following code: if($r['mail_read'] == 0) { $db->query("UPDATE mail SET mail_read=1 WHERE mail_to=$userid AND mail_id=$id LIMIT 1"); $db->query("UPDATE users SET new_mail=new_mail-1 WHERE userid=$userid"); } Every time you read a mail, regardless of if it's new or old, it will reduce your new_mail counter by one. A quick "SELECT new_mail FROM users WHERE userid=your_id_here" will tell you just how many new mails you'd need to receive before you get back in positive values. A little "UPDATE users SET new_mail=new_mail-1 WHERE userid=$userid AND new_mail > 0" change may help you in the future. :wink:
×
×
  • Create New...