Jump to content

how would i do this in php??????


Jiraiya

Recommended Posts

Something simple like this I'd use an INT UNSIGNED field in the database.

 

10 - I presume you mean minutes? One monite is 60 so 10 minutes is 600.

 

Write time()+600 into your table

$endtime=time()+600;
mysql_query("UPDATE table SET endtime=".$endtime);

 

Then just keep checking if the time has expired.

$row=mysql_fetch_assoc(mysql_query("SELECT endtime FROM table"));
if ($row['endtime']<time()) {
  //10 minutes is up
} else {
  //10 minutes not yet passed
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.