From: "Free Grafton" <[EMAIL PROTECTED]>

> We provide a MySQL, PHP solution to customers. One of the fields that we
> store for the customers are birthdates. We just recently upgraded from Red
> Hat 7.1 to Red Hat 9.0 and now have realized that at version 7.3 they
> changed it where strtotime no longer shows values before 1/1/1970 as
> negative values. It nows creates a ­1 error. Thus, we are now left with
any
> individual over the age of 33 to not be able to calculate their birthdate.
> This is quite frustrating as there are no other functions that can handle
> this that we have found. I have looked around the PHP boards and it
appears
> that individuals are having to build custom functions to handle this and
are
> also frustrated with this issue.

You can use this in your query to calculate the age:

year(current_date) - year(dob) -
(if(dayofyear(dob)>dayofyear(current_date),1,0))

where "dob" is the Date of Birth column in a MySQL DATE format.

---John Holmes...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to