<?php
//Start session
session_start();
//Include database connection details
require_once('connection.php');
$email = $_POST["email"];
$pass = $_POST["password"];
// Select the database to use
$query = "SELECT * FROM users WHERE email=$email and password=$password";
$result = mysqli_query($connection, $query);
$row = mysqli_fetch_array($result);
if($row["email"]==$email && $row["password"]==$pass)
echo"You are successful login.";
else
echo"Sorry, your email or password is not valid, Please try again.";
?>
I tried to code the line of error return after $result but the same error display after login.
this error shows up
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in D:\XAMPP\htdocs\codeinventor\login.php on line 18
Sorry, your email or password is not valid, Please try again.