知道为什么这不起作用?当我运行它时,它不会显示任何内容。
$qry = mysql_query(" SELECT SUM(payment_received) AS total FROM Orders ");
{
$row = mysql_fetch_assoc($qry);
echo $row['total'];
}
感谢您的帮助。
答案 0 :(得分:1)
$result = mysql_query("SELECT SUM(payment_received) AS total FROM Orders") or die(mysql_error());
$row = mysql_fetch_assoc($result);
print_r($row);
答案 1 :(得分:1)
使用以下示例
更正您的代码$qry = mysql_query("SELECT SUM(payment_received) AS total FROM Orders");
while ($row = mysql_fetch_assoc($qry)) {
{
echo $row["total"];
}