以下是我的域名,密碼和服務器。我怎麼能改變代碼。因爲每次加載站點時都會顯示錯誤「無法選擇數據庫」。請幫我看看我的代碼:(將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