Hi,
I want to know how to calculate number of days from past date(obtained from database) until now(current date).The situation is,I want it display how long that user have joined the group on his/her profile page.And also,I want it to display
in format like this:
Joined Since = $start_date
Duration = $numOfDay
Actually,for the duration I want it to display in format $year $month $day.
Example:
Joined Since = 21 May 2005
Duration = 1year 1month 1days
(maybe the duration wrong,but it just for example)
I've try this code,for calculate number of days:
// MySQL Connection
// Get all the data from the table
$result = mysql_query("SELECT * FROM tarikh")
or die(mysql_error());
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $result )) {
$numOfDay = date('Y/m/d') - date(strtotime($start_date));
echo $numOfDay;
}
It display some number that I don't understand what it is.Anyone have any idea.
Thank you in advance
Regards,
Duelist