marksie1988 Posted August 6, 2007 Share Posted August 6, 2007 i need to know what i should record a dob as in mysql to then display it on a webpage with and age not dob so that the age auto updates? i know this is possible but i dont know how to do it. i have the line that i need for the mysql database just dont know how to tell php to convert it to an age `dob` date NOT NULL default '0001-01-01', Quote Link to comment https://forums.phpfreaks.com/topic/63542-solved-date-of-birth-to-display-as-age/ Share on other sites More sharing options...
gurroa Posted August 10, 2007 Share Posted August 10, 2007 $dop = '1981-07-13'; $age = Date("Ymd") - Date("Ymd", strtotime($dop)); echo 'I\'m '.floor($age / 10000).' years old.'; Quote Link to comment https://forums.phpfreaks.com/topic/63542-solved-date-of-birth-to-display-as-age/#findComment-320219 Share on other sites More sharing options...
marksie1988 Posted August 10, 2007 Author Share Posted August 10, 2007 oops sorry i solved this a while back but forgot to solve it :S sorry fella Quote Link to comment https://forums.phpfreaks.com/topic/63542-solved-date-of-birth-to-display-as-age/#findComment-320413 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.