Home » Php » Compare SQl Varchar Value with Current Date in Php?

Compare SQl Varchar Value with Current Date in Php?

Posted by: admin February 25, 2020 Leave a comment

Questions:

After Implementing the Current Situation my row becomes red… the issue is it’s only comparing with the current date… Not with the current month & Year… Want to Compare with month and Year Too… Let you Know $enddate is fetching from Mysql which is Varchar Value

$enddate = $get_students_row['course_end_date'];
$ced = strtotime("$enddate");
$newformat = date('d/m/Y',$ced);
$currentdate = date('d/m/Y');

To Define

<tr <?php if(($newformat <= $currentdate)): ?> style="color:red;" <?php endif; ?>>

Also, I Want to Count the Number of $newformat

How to&Answers: