Specify PHP code to select dates and records 3 days old

后端 未结 2 1385
轮回少年
轮回少年 2021-01-28 18:23

I am trying to call data from SQL table that is only 3 days old

My table has a lbs-date column in it and is date format. I have tried the following but get no result fro

2条回答
  •  攒了一身酷
    2021-01-28 19:08

    SELECT *, DATE_FORMAT(lbs_date, '%y,%m,%d') 
    FROM lbs_trace_etrack 
    WHERE lbs_date >= CURDATE() - INTERVAL 3 DAY 
    ORDER BY lbs_date DESC
    

提交回复
热议问题