// This works fine, but does not update in detail view, only when I enter the individual data ... what do I do? help ....

// I think I have the same problem the user said: aarlauskas
// Year, Month and Days
function persons_init(&$options, $memberInfo, &$args) {
if(isset($_REQUEST['SelectedID'])){
$id=makeSafe($_REQUEST['SelectedID']);
$today=date('Y-m-d');
$birth=sqlvalue("SELECT date from persons where id='{$id}'");
$date1 = new DateTime();
$date2 = new DateTime($birth);
$date3 = new DateTime($birth);
$interval = $date1->diff($date2);
$interval = $date1->diff($date3);
$years=$interval->format('%y');
$month=$interval->format('%m');
$days=$interval->format('%d');
sql("update persons set year=floor(datediff('{$today}', date) / 365.25) where id='{$id}'", $eo);
sql("update persons set year='{$years}', month='{$month}', days='{$days}' where id='{$id}'", $eo);
}
return TRUE;
}
Luis Ramirez R.