Got a small code problem,
basically... I have a record set which pulls results from the mysql database and stores them as a array called $row_getloss
now I need to find a way adding together field within this array called loss... so it will be $row_getloss['loss']
I have the following code, but as you see from this test page here it doesnt add the values together, just outputs them as a list...
<?php
mysql_select_db($database_Betfair, $Betfair);
$query_getloss = "SELECT * FROM race_results";
$getloss = mysql_query($query_getloss, $Betfair) or die(mysql_error());
$row_getloss = mysql_fetch_assoc($getloss);
$totalRows_getloss = mysql_num_rows($getloss);
while($row_getloss = mysql_fetch_array($getloss))
{
$loss = array($row_getloss['loss']);
echo array_sum($loss);
}
?>
It seems to loop the array as to get the values i need... but the array_sum bit isnt working :s
Any Ideas.