我怎样才能让它发挥作用?
class Database {
public $mysqli;
public function connect() {
$this->mysqli = new mysqli('localhost', 'root', '', 'hltv');
}
public function sqlQuery() {
if($rows = $this->mysqli->query("SELECT * FROM users")) {
echo $rows->numRows();
}
}
}
说,
致命错误:调用 C:\xampp\htdocs\hltv_new\includes\databas 中未定义的方法 mysqli_result::numRows()