MySQL/PHP - Time Passed

MutSteath

New Member
How can I calculate the amount of 5 minuet periods passed with a datetime type?is it possible?\[code\]//Update AP (+1 points every 5 mins)// PLAN OF ACTION (for ap update)!// 1. check how long it has been since last update // 2. calculate how many 5 min periods has passed // 3. update $ap accordinly if ($last_ap_update != "0000-00-00 00:00:00"){ //Make sure last_ap_update has a value}else{ //If the last update is NULL, It must be players first page load. So set datetime equal to NOW $query = "UPDATE `stats` SET `last_ap_update` = NOW() WHERE `member_id` = {$_SESSION['SESS_MEMBER_ID']}"; $queryresult = @mysql_query($query);}\[/code\]
 
Top