I would like to compare PHP:
$now = date('Y-d-m H:i:s');
with mysql CURRENT_DATE() and die();
I need to check if the mysql current_date is the same as $now.
However, I don’t know how to do that. I would probably need some format change to CURRENT_DATE() too so I can compare it with $now = date('Y-d-m H:i:s');
Is this possible?
If yes, what would php code look like?
In MySQL the
CURDATE()returns the current date in ‘YYYY-MM-DD’ format or ‘YYYYMMDD’ format depending on whether numeric or string is used in the function.CURRENT_DATEandCURRENT_DATE()are the synonym ofCURDATE().Example of MySql – curdate() function
Example of MySql – curdate() function in numeric format
i have used the mysql_* function only for i understand i don’t recommended to use mysql_* function