Calculating months and years of 2 dates using

Hi all,

I am trying to get amount of how many weeks and how many months and years from 2 dates and this is what i have atmm

$Query="SELECT DATEDIFF($today)-DATEDIFF($joineddate) FROM members WHERE username='$username'";
	echo $Query;
	$result = mysqli_query($con,$Query);
	   $days = mysqli_fetch_array($result);
	   return $days[0];

Its not working the way i want though am i doing somthing wrong,

Any help would be good,Thanks

You are doing a few things wrong. Perhaps read those links and come back if you still have problems.

the mysql DATEDIFF function requires two parameters, not one

this type of confusion could easily be avoided with a very quick, very simple check of da manual

we’ve been through this before :slight_smile: