select from a mysql table records that belong to today
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());
精彩评论