Jump to content
MakeWebGames

time code


jamiee
 Share

Recommended Posts

Re: time code

Yes.

Use Unix_timestamp() for this.

Example:

$last_on_page = mysql_query("SELECT * FROM users WHERE laston=UNIX_TIMESTAMP()+36000 AND userid=$userid"); // simple maths 60*60*10

if (!$last_on_page){
echo "Last on at: Less Than ten minutes."}
else{
echo "Last on at: $last_on_page"}
Link to comment
Share on other sites

Re: time code

You would need to track their usage somehow. Either in a new table or in the User table. The field would track when they used the thing last.

When you update the field via SQL use unix_timestamp()

When you run your If statement do a compare using the PHP function time()

Edit; I guess I got distracted and got beaten to the punch on this post. lol

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