/* 设置memcache锁,解决查询过多email查询为空的问题 Begin */
$mmc = new Memcache;
$mmc->connect('127.0.0.1', 11211) or die ("Could not connect");
if(!empty($mmc)){
$sending=$mmc->get('sending');
$sending=intval($sending);
}else{
//如果不能使用memcache,则以不影响发送为主
$sending=0;
}
if($sending==1) die("发送频率太大,请稍后再试.");
/* 发送开始 */
$mmc->add('sending',1);
$result=$db->fetch_first("SELECT email from table ");
sendmail("$result[email]",title,content);
$mmc->replace('sending',0);
/* 设置memcache锁,解决查询过多email查询为空的问题 End */
转载于:https://www.cnblogs.com/zsmynl/p/3559851.html
相关资源:各显卡算力对照表!