What is the proper way to query all data on current date? a function in mysql that will get the current date in 12:01 am and current date 11:59 pm
select * from tb_data where date between currentdate_starts and currentdate_ends
Try using CURDATE()
SELECT field FROM table WHERE DATE(column) = CURDATE()
select * from tb_data where DATE(date) = CURDATE()
Documentation: CURDATE
Without using DATE(column) = CURDATE()
SELECT * FROM tb_data WHERE date between concat(curdate(),' ','00:00:00') AND concat(curdate(),' ','23:59:59')
more info
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With