PHP MySQL列SUM。 SUM显示空白屏幕

时间:2019-05-12 18:18:47

标签: php mysql mysqli

处理完查询后,只有空白的白色屏幕,我已经尝试了所有可能找到并想到的内容,请看一下我的代码,也许我做错了什么。screenshot screenshot2 [截屏{{ 3}}

  

Blockquote

    $conn = new mysqli($servername, $username, $password, $dbname);

    if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
    }

    $result= mysql_query("SELECT SUM(Amount) AS totalsum FROM FORM1");

    $row = mysql_fetch_assoc($result); 

    $sum = $row['totalsum'];

    echo ("This is the sum: $sum");

0 个答案:

没有答案