Jump to content

time code


Recommended Posts

Re: time code


Use Unix_timestamp() for this.


$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."}
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.

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.

  • Create New...