I have made a script that displays persons who are having their birthday today. Beside this, I would like to show the age of those persons. I have found many workable solutions, but I don't know how to implement in my current code.
Here's my current code:
<?php
$sql = "SELECT * FROM birthday WHERE MONTH(dob) = MONTH(NOW()) AND DAY(dob) = DAY(NOW())";
$result = $conn->query($sql);
if($result->num_rows > 0)
{
while($row = $result->fetch_assoc())
{
echo "<p>".$row["first_name"]." ".$row["last_name"]."</p>";
}
}
else
{
echo "There are no birthdays today";
}
$conn->close();