我想隐藏已过的日期。

"SELECT * FROM " . USER_TABLE_NAME . " AS cu
 INNER JOIN " . JOB_TABLE_NAME . " AS jb
 ON jb.user_id = cu.user_id
 WHERE cu.user_id = '$userID'
 ORDER BY jb.job_date DESC, jb.job_tea_time DESC";


现在我正在获取所有数据order by date.

日期存储在VARCHAR中,我不打算更改它。

谢谢,

最佳答案

我认为这会有所帮助

"SELECT * FROM " . USER_TABLE_NAME . " AS cu
 INNER JOIN " . JOB_TABLE_NAME . " AS jb
 ON jb.user_id = cu.user_id
 WHERE cu.user_id = '$userID' AND STR_TO_DATE(jb.job_date,'%d/%m/%Y') >= now()
 ORDER BY jb.job_date DESC, jb.job_tea_time DESC;

关于php - 如何隐藏日期已过的数据,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/23004437/

10-13 04:42