我的计算机上运行着一个localhost网站,数据库由feesqldatabase.com托管
我计算机上的php是PHP 7.2.26
Apache / 2.4.18(Ubuntu)
数据库客户端版本:libmysql-mysqlnd 5.0.12-dev-20150407- $ Id:b5c5906d452ec590732a93b051f3827e02749b83 $
PHP扩展名:mysqliDocumentation mbstringDocumentation
PHP版本:7.0.33-0ubuntu0.16.04.3
代码
在我的dbh.inc.php内
$dbServername = "sql.freesqldatabase.com";
$dbUsername = "sql";
$dbPassword = "*********";
$dbName = "sql";
在我的index.php内
<?php
require 'dbh.inc.php';
$mysqli = new mysqli("$dbServername", "$dbUsername", "$dbPassword", "$dbName");
$result = $mysqli->query("SELECT * FROM acs;");
$row = $result->fetch_assoc($result);
echo htmlentities($row[1]);
?>
现在我遇到此错误
致命错误:未捕获错误:在中找不到类'mysqli' C:\ Users \ squ0l \ Website \ index.php:184堆栈跟踪:#0 {main}被抛出 C:\ Users \ squ0l \ Website \ index.php,第184行