显示一些错误
<?php
session_start();
$hostname = "localhost";
$username = "root";
$password = "";
$dbname = "student_information_management";
$con = mysqli_connect($hostname, $username, $password) or die(mysqli_connect_error());
if ($con) {
mysqli_select_db($dbname) or die(mysqli_connect_error());
}
这是警告我 警告:mysqli_select_db()恰好需要2个参数,第9行的C:\ xampp \ htdocs \ std_management_system \ config.php中给出1个参数
答案 0 :(得分:0)
请阅读mysqli_select_db的文档。在程序样式中,必须提供以下参数才能起作用:
链接:仅用于程序样式:mysqli_connect()或mysqli_init()返回的链接标识符
dbname:数据库名称。
示例:
mysqli_select_db($con, $dbname);