Here's the latest. I can print the numbers but still have no idea how to show a sum. I thought this would be very simple myself. I just can't get anything to work.
$query12 = "SELECT SUM(value) FROM value LEFT JOIN horsevalue ON horsevalue.value_id = value.id WHERE horsevalue.horse_id = $horse_id AND horsevalue.value_id = ".$row['id'];
$result12 = mysql_query($query12) or die(mysql_error());
while($row12 = mysql_fetch_array($result12)){
//echo ( $row12['SUM(value)'] ) ;
print("<pre>".print_r($row12['SUM(value)'],true)."</pre>");
}
Output:
200
300
600
400
500
500
500
400
800
200
400