I have the following SQL query and I would like to output the ageOnLastSeptember date in a UK (dd/mm/yyyy) format. Can anyone tell me how I can achieve this?
$sql="select ( if(month(now()) < 9, year(now()) - 1, year(now())) - year(dob) - if(month(dob)<9, 0, 1) ) as ageOnLastSeptember,first_name,last_name,dob,school,contact_no,family_id,contact_id from members_family where contact_id = '$contact_id' ";
I tried the following but it did nothing
$sql="select date_format(( if(month(now()) < 9, year(now()) - 1, year(now())) - year(dob) - if(month(dob)<9, 0, 1) ), '%d/%m/%Y') as ageOnLastSeptember,first_name,last_name,dob,school,contact_no,family_id,contact_id from members_family where contact_id = '$contact_id' ";