我正在嘗試SELECT COUNT表的總記錄,我做錯了什麼?在此先感謝致命錯誤:調用布爾型的成員函數fetch_row()
我收到此錯誤
Fatal error: Call to a member function fetch_row() on boolean
<?php
$mysqli = new mysqli('localhost','root','','testing');
//Output any connection error
if ($mysqli->connect_error) {
die('Error : ('. $mysqli->connect_errno .') '. $mysqli->connect_error);
}
//get total number of records
$results = $mysqli->query("SELECT COUNT(*) FROM users");
$get_total_rows = $results->fetch_row(); //hold total records in variable
$mysqli->close();
?>
是的,解決了它,我有'用戶'而不是'用戶'...我沒有看到任何有關谷歌fetch_row ...感謝您的幫助! – Ris
你,歡迎和享受! –