function data1 ($d_year, $d_short, $d_name)
{
$row=mysql_fetch_array(mysql_query("SELECT * FROM database WHERE country='$d_short' AND year='$d_year'"));
echo"<b>$d_name ".$one=$row['sum']." EUR</b><div id='accitem'>".$row['paste']."</div>";
return $one;
};
我有多行,每次都有不同的 $one 值。
data1 ("1", "uk", "United Kingdom"); $c_nat=$c_nat+$one;
data1 ("1", "us", "United States"); $c_nat=$c_nat+$one;
echo $c_nat;
最后,我想总结所有行。请提供建议和帮助;)