Try something along the lines of

if($current_MM < $MM) {
    $age = $calculatedage - 1;

you'll also need to do something like this with the day of the month if the
user's bday is in the current month.
at least... i think that works out :$
Craig Roberts

"John Ryan" <[EMAIL PROTECTED]> wrote in message
> Hi,
> In mySQL, I store dates as YYYY-MM-DD, a standard DATE type. It stores
> date of births. I need to calculate in a PHP script, the users age from
> DOB. I get a PHP date in the same format as the mySQL and subtract, which
> returns the year rounded off. ie, it doesnt matter if your birthdays in
> of 1983 and the date is januray 2003, your age is still returned as 20,
> it should be 19.
> Does anyone know how can i get the right age?

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to