Im trying to figure out how can I make an if statement to compare todays date with a date field in a table.
<?php
$dayte_today = date('Y-m-d');
$plannerid = $_GET["plannerid"];
$sql="SELECT * FROM planner_content WHERE planner_id='$plannerid'";
$result=mysqli_query($con,$sql)or die(mysqli_error($con));
// Mysql_num_row is counting table row
$count=mysqli_num_rows($result);
if($count>=1){
/* echo "Your id is $userID"; */
while ($link = mysqli_fetch_object($result)) {
echo ''.$link->date.' - '.$link->comment.'' ;
}
}
else {
echo "No events yet";
}
?>
I've got it to show results for the moment, but I don't know how to compare the actual date with the date in the table. I tried to use mysqli_fetch_object but I didn'y get it to work.