这是迄今为止的代码
$result = mysqli_query($con,"SELECT * FROM users WHERE User_Last_Login> ");
user_last_login的格式为yyyy-mm-dd
答案 0 :(得分:2)
SELECT * FROM users WHERE User_Last_Login < DATE_SUB(NOW(), INTERVAL 6 MONTH)
或
SELECT * FROM users WHERE User_Last_Login < NOW() - INTERVAL 6 MONTH
或
SELECT * FROM users WHERE User_Last_Login < DATE_SUB(CURDATE(), INTERVAL 6 MONTH)