In the Statistics section of the forum, would it be too difficult to add the average member age to the existing statistics? Not that it’s very important, nor 100% accurate (people don’t always put their correct BD). I just think it’d be an interesting snippet of info. ![]()
interesting, I think I might be able to do this my self! though it adds a extra query to the index page!
Sweet ![]()
I posted at the vb forums, I will see if I get any replies! I found a code, but gives the avg age of around 1.000 which isnt right!
[QUOTE=Sniper]
I posted at the vb forums, I will see if I get any replies! I found a code, but gives the avg age of around 1.000 which isnt right!
[/QUOTE]
Hmm, I wonder if that has anything to do with people not including their birthdays at all? I wonder if those cases can be filtered out of the data set…
it sure can be, but not the fake dates? not had a reply at the vbforums yet!
You can filter.
We could even write the thing ourselves.
heres the code in php/mysql
[PHP]// average age
$result=$DB_site->query_first(“SELECT YEAR(NOW())-AVG(YEAR(birthday)) AS avgage FROM user WHERE YEAR(birthday) <> 0”);
$age=$result[‘avgage’];[/PHP]
what it does it take the current year - the average year of birth, which should give the average age!
its ok, I got it!
Edit: Average Age: 25
Nice! Hmm, the avg. age is a little older than I thought it would be. :good:
yeh! but you have to consider people, who have provided a false date of birth!
yeah i put my age as 14 now. and i’m 14…now.
thanks dude ![]()