我正在尝试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
你,欢迎和享受! –