开发者

select from a mysql table records that belong to today

开发者 https://www.devze.com 2023-02-13 09:25 出处:网络
i have a field in my table called time its INT and iam using ph开发者_开发百科p time() function

i have a field in my table called time its INT and iam using ph开发者_开发百科p time() function now i want select all records that its time is today


SELECT time FROM table WHERE DATE(column) = CURDATE();  

Check the following link :

  • Retrieve records by current date from MySQL


$sql = "SELECT * FROM table WHERE time >= '".strtotime("today")."' AND time < '".strtotime("tommorow")."'";


SELECT * FROM mytable where DATE(`time`) = DATE(NOW());
0

精彩评论

暂无评论...
验证码 换一张
取 消