//$time in the second php code hold the time stored in the database in the same format as above(ie TIMESTAMP Format)
//Save the first php code as timeago.php
//include first php code u saved in the second php code as i have done..
//Use the Second Php code Wherever You Want to show time ago.