我从w3schools复制了这段代码并尝试运行它。我得到一个显示器直到"创建连接。" 然后既没有错误信息也没有成功信息 我已经确保了以下命令用于错误报告,但我仍然得到一个空白页面:
<?php
ini_set('display_errors', 'On');
ini_set('html_errors', 0);
error_reporting(-1);
$servername = "localhost";
$username = "root";
$password = "root@123";
echo "Create connection";
$conn = new mysqli($servername, $username, $password);
echo "Check connection";
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
// Create database
$sql = "CREATE DATABASE myDB";
if ($conn->query($sql) === TRUE) {
echo "Database created successfully";
} else {
echo "Error creating database: " . $conn->error;
}
echo "closing";
$conn->close();
?>
谁能告诉我这是什么问题?