문제

I need help to cancel a process of deleting a row in mysql using PHP! The thing is that I want to delete inactive accounts if they have not been active before 24 hours!

How I delete now:

DELETE FROM members WHERE passkey_valid <= DATE_SUB(NOW(), INTERVAL 1 DAY);
도움이 되었습니까?

해결책

Create a column called "validated" with "YES" as a value and upon deletion of others later on, use WHERE .... validated !='YES' as an example.

DELETE FROM members WHERE validated !='YES' 
AND passkey_valid <= DATE_SUB(NOW(), INTERVAL 1 DAY);

Your INSERT could resemble something like this:

$validated = "YES";

$query = "INSERT INTO members (validated,date) 
    VALUES ('$validated', NOW() )";
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top