我尝试在PHP中回显一个MySQLi SELECT SUM查询结果,但它没有回显结果

时间:2016-09-13 09:06:30

标签: php mysqli

这是查询:

$querySum = "SELECT SUM(realcost)FROM checking-apartments ";
$result1 = mysqli_query($link, $querySum);

这就是我试图回应的地方:

echo'<table id="tableSum">';
while($row = $result1->fetch_array())
{
echo '<td style="padding-left:1200px; font-weight:bold;">Total Estimated Costs: ' . $row['$result1'] . '</td>
<td style="font-weight:bold;">Total Real Costs: ' . $row['$result1'] . '</td>';
}
echo '</table>';

0 个答案:

没有答案