事情是这样的。 这样的代码能行:
$servername = "localhost";
$username = "username";
$password = "password";
// 创建连接
$conn = new mysqli($servername, $username, $password);
// 检测连接
if ($conn->connect_error) {
die("连接失败: " . $conn->connect_error);
}
echo "连接成功";
这样的代码能行:
$servername = "localhost";
$username = "username";
$password = "password";
$link = mysqli_connect($servername, $username, $password, 'wxjs');
if (!$link) {
echo "Error