以下是我的域名,密码和服务器。我怎么能改变代码。因为每次加载站点时都会显示错误“无法选择数据库”。请帮我看看我的代码:(将localhost更改为域名
[
dbConfig.php
<?php
$dbhost = 'localhost';
$dbusername = 'root';
$dbpassword = '';
$dbname = 'calendarevent';
$db = new mysqli($dbhost, $dbusername, $dbpassword, $dbname);
if ($db->connect_error) {
die("Connection failed: " . $db->connect_error);
}
?>
数据库是'calendarevent'还是连字符号? – chris85