1
我希望從數據庫中找到某些項目的計數。我用這個代碼找到數據庫中的數據計數
$sql=" SELECT count(*) from request WHERE status = '0'";
$result = mysqli_query($con, $sql);
if(mysqli_num_rows($result)>0)
{
while($row = mysqli_fetch_assoc($result))
{
echo "<pre>";
print_r($row);
echo "</pre>";
}
}
我得到這個數組中
Array
(
[count(1)] => 1
)
行從該數組提取值,我用
$total = $row[0];
echo $total;
,但沒有得到任何結果。我如何從這個數組中取值