如何让 PHP 每月删除用户限制
我有这个代码来增加用户搜索限制,如果他们达到他们的限制
$search = $db->prepare("SELECT `searched` FROM `search` WHERE `user_id` =:user_id");
$search->bindValue(':user_id', $vbulletin->userinfo['userid'], PDO::PARAM_INT);
$search->execute();
$result = $search->fetch(PDO::FETCH_ASSOC);
if ($result['searched'] >= 100){
exit('You have reached your search limit for this month.<br>');
}
$addsearch = $db->prepare("UPDATE `evomap`.`search` SET `searched` = :searched + 1 WHERE `search`.`id` =:user_id;");
$addsearch->bindValue(':user_id', $vbulletin->userinfo['userid'], PDO::PARAM_INT);
$addsearch->bindValue(':searched', $result['searched'], PDO::PARAM_STR);
$addsearch->execute();
/* page i want to execute if user has no reached limit */