我在一个PHP页面上有两个查询:
<?php
$query = "SELECT *, SUM(commission1) FROM agents WHERE b=1"; //GROUP BY commission1"
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result)){
echo "Total = ". $row['SUM(commission1)'] . " ";
}
?>
<?php
$query = "SELECT *, SUM(commission2) FROM agents WHERE b=2"; //GROUP BY commission2"
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result)){
echo "Total = ". $row['SUM(commission2)'] . " ";
}
?>
我想将两个结果添加到单独的行中。 我试图找到一种解决方案,但没有。