Question: I need solution: Warning : mysqli_fetch_array() expects parameter1 to be mysqli_result, boolean given in C:xampphtdocsWeb0login.php on line 86 the code:
I need solution:
Warning: mysqli_fetch_array() expects parameter1 to be mysqli_result, boolean given inC:xampphtdocsWeb0login.php on line86
the code:
//server information
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "project";
//connect to the database Try Again
$conn = new mysqli($servername, $username,$password, $dbname);
// check the connection
if ($conn->connect_error) {
die("Connection failed:" . $conn->connect_error);
}
$username = $_POST['username'];
$password = $_POST['password'];
$type = $_POST['type'];
//
$sql = "SELECT * FROM users,seller,adminnWHERE username = '$username' AND password = '$password'";
$result=mysqli_query($conn,$sql);
$row=mysqli_fetch_array($result,MYSQLI_ASSOC);
if($row['username']==$username &&$row['password']==$password){
switch($row['type']){
case 'Sdmin':
header("location: admin/Admin.php");
break;
case 'Seller':
header("location: seller/sellerpage.php");
break;
}
}else {
echo"
";
echo "
}
?>
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
