This is the query I am using and it is in page 1 not inside the function.
<?php
$sql2= mysql_query("SELECT *
FROM catego WHERE category_id = '$idc'");
$categoryCount = mysql_num_rows($sql2);
if ($categoryCount>0 )
{
$row2 = mysql_fetch_array($sql2);
$id = $row2["category_id"];
$birthdate = $row2["birthdate"];
$address = $row2["address"];
}
?>
A simple php function could be something like the following:
i.e split on your commas, work out the differences, adjust for which side of their birthdate the day/month is, if so reduce the year by one, then just return the year.
Then in your page you can put:
EDIT: