I'm simply trying to get the sum of two variables i got from a mysql query:
....
$query = "SELECT AVG(pins) AS average, handicap
FROM bowling WHERE playerID = $pid .... ";
....
$my = mysql_fetch_array($res,MYSQL_ASSOC);
$sum = $my[average] + $my[handicap];
echo $my[average]." + ".$my[handicap]." = ".$sum;
I wonder why the output looks like that:
145.500000 + 24.950000 = 169
The code above just adds the int values - not the doubles, as desired....
Does anyone know, why? Whats wrong with my code?
Thank you for replying.
McIheal