Help me revise mySQL query
I'm trying to check if the throttling date reminder is today and the throttling end date hasn't passed yet, but I don't want it to be displayed. The problem is that the query I made is not working in mysql. Can anyone help me revise my request?
Here is my request:
$query="select * from t_regulation where dt_reminder >= '$today' and dt_ended ='$today'"
0
a source to share
3 answers
Very often I run into the problem that my date variable is a string that hasn't been formatted correctly for the default date timestamp in Mysql.
Remember that this comparison must be "yyyy-mm-dd".
Also, since since the date has ended hasn't passed yet, there shouldn't be:
$ query = "select * from t_regulation, where dt_reminder> = '$ today' and (dt_ended> '$ today' or dt_ended is null)"
0
a source to share