Jump to content
MakeWebGames

Time Stamp Help?


The Ace
 Share

Recommended Posts

Hello. I need an SQL query that will update users to whatever I enter, but only to those users who have logged in in the past 3 days.

UPDATE `users` SET `bankmoney=bankmoney+10000` WHERE `bankmoney` != '-1' AND `fedjail` = '0' AND `last_login` ......;

The ...... is where the unix time stamp is for the people who have logged in in the past three days. I'm not good with unix time stamps....may someone please help me?

Cheers,

The Ace

Link to comment
Share on other sites

Guest Anonymous

Re: Time Stamp Help?

UPDATE users

SET bankmoney = bankmoney + 10000

WHERE ((bankmoney >= 0) AND (fedjail <= 0) AND (last_login >= (UNIX_TIMESTAMP() - (3 * 86400))))

Adjusting the "3" would alter the number of days ...

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...