我是 Mysqli_* 的新手,我收到以下错误:
警告:mysqli_select_db() 期望参数 1 为 mysqli,字符串在第 11 行的 D:\Hosting\9864230\html\includes\connection.php 中给出
警告:mysqli_error() 需要 1 个参数,0 在第 13 行的 D:\Hosting\9864230\html\includes\connection.php 中给出
数据库选择失败:
<?php
require("constants.php");
// 1. Create a database connection
$connection = mysqli_connect(DB_SERVER,DB_USER,DB_PASS);
if (!$connection) {
die("Database connection failed: " . mysqli_error());
}
// 2. Select a database to use
$db_select = mysqli_select_db(DB_NAME,$connection);
if (!$db_select) {
die("Database selection failed: " . mysqli_error());
}
?>