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

Recommended Answers

All 3 Replies

following code will return age in days for each user

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

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!

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.