Help work out age in PHP

Ok this is simple but I don’t know jack about mysql or php.

In flash I have a “dob” list box.

This pulls the dob from mysql in the for of “1989”

 $dob = mysql_result($fewComments, $i, 'dob');

This is where I am sending that information to flash, but I dont want to send 1989, I want to send 15.

 
print "<br>&writeage=";
if($numallComments == 0) { print "	 No entries yet.."; } 
else { $i = 0;
$dob = mysql_result($fewComments, $i, 'dob');
print'<b>Age: </b>'. $dob .'';}

I am assuming it is CURRENTDATE() - 1989 but I don’t know how to format CURRENTDATE so I can minus 1989

Any help or hints much appreciated…

echo date("Y"); #will return Year if i am not mistaken 

Date

Hey thanks for that ol4pr0

The link showed

$today = date(“j, n, Y”); // 10, 3, 2001

which gave me

$today = date(“Y”);
$dob = $today - $dob;

I thought I tried that or something very close to it… but then I did try 7 or 8 different variations…

I guess 3 hours sleep in 48hours dont help much either…

Thanks for that… now I can almost og to bed. :slight_smile: