且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何限制用户多久可以将mysql值更新到数据库

更新时间:2023-02-17 07:44:47

在db(last_update)type = data中创建新行

Create new row into db (last_update) type= data

//return to sql last_update (select db ...)

$current_Data = date ('Y-m-d');
$current_Data_time = strtotime ($current_Data); //convert data to time
$last_update_p3 = strtotime ("+3day", strtotime($last_update));
$last_update_p3 = strtotime ($last_update_p3);//convert data to time

if($current_Data_time <=$last_update_p3)
{
 $sql = $con->query("UPDATE users SET HWID = '{$UpdateHWID}' , last_update='{$current_Data}'  where UserID = $User");
//update last data with current date 
}
else
{
//It has not gone three days 
}