Question: When i run my PHP code i get the following error, could you please explain to me what i should do to resolve this erro

When i run my PHP code i get the following error, could you please explain to me what i should do to resolve this erro thanks...

When i run my PHP code i get the following error,________________Code Below__________________________________

****************config.php*********************

define("HOST","127.0.0.1"); define("DB_USER","root"); define("DB_PASS",""); define("DB_NAME","demo"); $conn = mysqli_connect(HOST,DB_USER,DB_PASS,DB_NAME); //$conn = new mysqli(HOST, DB_USER, DB_PASS, DB_NAME); if(!$conn) { die(mysqli_error()); } function getUserAccessRoleByID($id) { global $conn; $query = "select user_role from tbl_user_role where id = ".$id; $rs = mysqli_query($conn,$query); $row = mysqli_fetch_assoc($rs); return $row['user_role']; } ?>

********************************login.html*****************************************

/**  * Created by PhpStorm.  * User: buccaneer43  * Date: 11/2/2018  */ session_start(); require_once('config.php'); if(isset($_POST['login'])) { if(!empty($_POST['email']) && !empty($_POST['password'])) { $email = trim($_POST['email']); $password = trim($_POST['password']); $md5Password = md5($password); $sql = "select * from tbl_users where email = '".$email."' and password = '".$md5Password."'"; $rs = mysqli_query($conn,$sql); $getNumRows = mysqli_num_rows($rs); if($getNumRows == 1) { $getUserRow = mysqli_fetch_assoc($rs); unset($getUserRow['password']); $_SESSION = $getUserRow; header('location:dashboard.php'); exit; } else  { $errorMsg = "Wrong email or password"; } } } if(isset($_GET['logout']) && $_GET['logout'] == true) { session_destroy(); header("location:index.php"); exit; } if(isset($_GET['lmsg']) && $_GET['lmsg'] == true) { $errorMsg = "Login required to access dashboard"; } ?>        

Queen Consolidated

Forgot password?
Warning: mysqli C:lUserslbuccalPhpstormProjectslACMlconfig.php on line S _connect0: The server requested authentication method unknown to the client [caching_sha2_password] in Warning: mysqli_connect0: (HY000/2054): The server requested authentication method unknown to the client in C:Userslbucca PhpstormProjectslACMlconfig.php on line 8 Warning: mysqli_errorO expects exactly 1 parameter, 0 given in C:Users bucca PhpstormProjectslACMconfig.php on line 13

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!