mysql中顯示幾日內的記錄
回傳公元0年到今日的總日數:
mysql>select to_days(now(0));
回傳公元0年到前三天的總日數:
mysql>select to_days(now()) - 3;
$sql="select * from books where to_days(dateandtime) >= (to_days(now()) - 3)
mysql>select to_days(now(0));
回傳公元0年到前三天的總日數:
mysql>select to_days(now()) - 3;
$sql="select * from books where to_days(dateandtime) >= (to_days(now()) - 3)
<< Home