Need help for DATE_FORMAT (p.date, '% Y-% m-% d') = CURDATE ()
I have a query to get today's records from a table. I have inserted a date field using now()
.
select u.*,p.* from user_brands as u inner join products as p where u.parent_id = p.cat_id and date_format( p.date, '%Y-%m-%d' ) = curdate( )
Using this query every time I get empty results, once, if I refresh the page, I get results. Why doesn't this return values ββthe first time?
+2
source to share
2 answers