I have an online credit app with several fields that are month and year selections (time at address, hire date, etc) and want to not only display the results (March, 2011) that the analyst views, but also the length based on when the app was originally submitted. Unfortunately I can not change the structure of the dB, so instead need to change the output of the php, but have been unsuccessful.
The rows are: "ap_add8" = Month (January - December full text,) "ap_add9" = Year (2014) and "submitted" = the date the ap was submitted (2014-03-24.)
I've tried`
$Difference = abs(strtotime($row['ap_add9'].'-'.date("m", mktime(0, 0, 0, $row['ad_add8']))) - strtotime(date("Y").'-'.date(m)));
$Years = floor($Difference / (365*60*60*24));
$Months = floor(($Difference - $Years * 365*60*60*24) / (30*60*60*24));
if ($Years !="0") {$Years = $Years.' years, ';} else {$Years = NULL;}
if ($Months !="0") {$Months = $Months.' months';} else {$Months = NULL;}`
To get it working based on todays date, but can't even get that working properly.