I want to use math functions on MysSQL, like avg, min and max.
... But it doesn't work !
examples :
$result142 = mysql_db_query("table", "select avg(age) from enquete");
$result143 = mysql_db_query("table", "select max(age) from enquete");
$result144 = mysql_db_query("table", "select min(age) from enquete");
... I think theses sentences are correct ...
But if then I write : echo $result142, I always get an arbitrary number "149" (supposed to be the average age of my visitors !).
and my age variable is an integer ...
What do I have to write to get the results of avg, min and max functions ?
Thank you for replying,
... But it doesn't work !
examples :
$result142 = mysql_db_query("table", "select avg(age) from enquete");
$result143 = mysql_db_query("table", "select max(age) from enquete");
$result144 = mysql_db_query("table", "select min(age) from enquete");
... I think theses sentences are correct ...
But if then I write : echo $result142, I always get an arbitrary number "149" (supposed to be the average age of my visitors !).
and my age variable is an integer ...
What do I have to write to get the results of avg, min and max functions ?
Thank you for replying,