0

Hi all,

Can anybody advise on how i can best use php and mysql to give a database record an "age" in days?

Im recording record creation via timestamp at the minute

Cheers

Paul

4
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by vharuna
1

following code will return age in days for each user

SELECT username,datediff( current_date( ) , birthdate ) 
FROM datatable
-1

following code will return age in days for each user
Help with Code Tags
PHP Syntax (Toggle Plain Text)
SELECT username,datediff( current_date( ) , birthdate )
FROM datatable

I thinks you are right!

0

can somebody help with a similar case. I have a table field that holds date of birth in the format; 1980/02/01. I need to display data based on months and days of birth alone.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.