<?php
$over_time=time()+3600;
$nowtime=time();
$query=$db->query("select down_time from members where uid='1'");
$down_time=$query->fect_assoc(); if($down_time['down_time']<$nowtime){
$db->query("update members set down_time=$over_time where uid='1'");
die('你成功得奖励!');
}else{
$latime=$down_time['down_time']-$nowtime;
die("你已经领过奖励了,请等$latime分钟后再试!");
}?>
这个判断有个问题,就是点得快一点后呢,可能就会给他两次以上的奖励。。主要看他的网络有多卡,我最多看到有给
8次奖励。有什么办法可以解决这个问题呢?
判断是否得过奖
更新
commit
MySQL官方文档 http://dev.mysql.com/doc/refman/5.1/zh/index.html