I think there's something off with my query. I can't get the right function that I want.
Example scenario:
If I recorded a prenatal checkup today, the add button will not appear after the next 30 days or one month.
But with this query after adding checkup today, the next day, the add button appeared already.
Here's my code:
$dateToday = date('Y-m-d');
$checkPatients = $conn->query("SELECT last_checkup FROM `prenatal_checkup` WHERE itr_no = '$_GET[id]' limit 1");
$fetchPatients = $checkPatients->fetch_array();
if($fetchPatients['last_checkup'] >= (date('m', strtotime('+1 month')) . '/01/' . date('Y', strtotime('+1 month')))){
echo '<div class="alert alert-danger" role="alert" style="font-weight: bold; margin-bottom:-13px;"><p>
'.ucfirst($_GET['firstname'])." ".ucfirst($_GET['lastname']). ' was already estimated her date of confinement.
Adding new data will be available again after one month. Please click the record below to proceed to next check up.</p></div>';
}
else
{
?>
<button class = "btn btn-primary" id = "show_com"><i class = "glyphicon glyphicon-plus">ADD</i></button>
<?php
}