我需要帮助来取消使用PHP删除mysql中的行的过程! 问题是,如果他们在24小时之前没有活动,我想删除非活动帐户!
我现在如何删除:
DELETE FROM members WHERE passkey_valid <= DATE_SUB(NOW(), INTERVAL 1 DAY);
答案 0 :(得分:0)
创建一个名为&#34;已验证的列&#34;与&#34;是&#34;作为一个值,稍后删除其他人时,请以WHERE .... validated !='YES'
为例。
DELETE FROM members WHERE validated !='YES'
AND passkey_valid <= DATE_SUB(NOW(), INTERVAL 1 DAY);
您的INSERT可能类似于以下内容:
$validated = "YES";
$query = "INSERT INTO members (validated,date)
VALUES ('$validated', NOW() )";