I want users on my page to verify thier accounts (email) in one day. If a user isn't verified yet the datetime (date) is set to something like 0000-03-23 15:45:56 (the year is 0000 - I know that this causes problems in new years eve).
Event: (every hour)
DELETE FROM users WHERE SUBSTR(date, 0, 4)='0000' AND DAY(TIMEDIFF(NOW(), date)) >= 1
The event isn't working so i've created this test query:
$resultOne = $mysqli->query("SHOW COLUMNS FROM users WHERE SUBSTR(date, 0, 4)='0000'")or die($mysqli->error);
$resultTwo = $mysqli->query("SHOW COLUMNS FROM users WHERE DAY(TIMEDIFF(NOW(), date)) >= 1")or die($mysqli->error);
Now i'm getting this error message:
Unknown column 'date' in 'where clause'
Questions:
- Why isn't it working?
- Which better ways to verify users do you recomment?
Thank you! - Minding