Mostafa Elkady
Mostafa Elkady

Reputation: 5781

select from a mysql table records that belong to today

i have a field in my table called time its INT and iam using php time() function now i want select all records that its time is today

Upvotes: 1

Views: 7786

Answers (3)

Saurabh Gokhale
Saurabh Gokhale

Reputation: 46395

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

Check the following link :

Upvotes: 8

Konerak
Konerak

Reputation: 39763

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

Upvotes: 2

Czechnology
Czechnology

Reputation: 14992

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

Upvotes: 3

Related Questions