警告:mysqli_connect():(HY000/1045):在C:\Users\xampp\htdocs\PHP_Login_Script\config中,用户"username"@"localhost"(使用密码:YES)的访问被拒绝.php第6行
警告:mysqli_real_escape_string()要求参数1为mysqli,布尔值在C:\Users\xampp\htdocs\PHP_Login_Script\Login中给出.php在线10
警告:mysqli_real_escape_string()要求参数1为mysqli,布尔值在C:\Users\xampp\htdocs\PHP_Login_Script\Login中给出.php第11行
警告:mysqli_query()要求参数1为mysqli,布尔值在C:\Users\xampp\htdocs\PHP_Login\u Script\Login中给出.php第15行
警告:mysqli_fetch_array()要求参数1为mysqli_result,在C:\Users\xampp\htdocs\PHP_Login_Script\Login中为空.php第16行
警告:mysqli_num_rows()要求参数1为mysqli_result,在C:\Users\xampp\htdocs\PHP_Login_Script\Login中为空.第19行的php
即使我的配置文件如下所示,我在localhost上也会出现上述错误:
<?php
define("DB_HOST", "localhost");
define("DB_USER", "root");
define("DB_PASSWORD", "");
define("DB_DATABASE", "databasename");
$db = mysqli_connect(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_DATABASE);
?>
这曾经奏效,但现在不行了.这段代码有什么问题吗?还是现在不起作用?This是我现在正在学习的教程.