i am always finding this error. if you have an idea.please assist as soon as possible
mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\validate_login.php on line 20
This is line with the problem as per text -editor(* $row = mysql_fetch_array($result);*)
<?php
// Grab User submitted information
$email = $_POST["users_email"];
$pass = $_POST["users_pass"];
// Connect to the database
$con = mysql_connect("localhost","root","");
// Make sure we connected succesfully
if(! $con)
{
die('Connection Failed'.mysql_error());
}
// Select the database to use
mysql_select_db("school",$con);
$result = mysql_query("SELECT users_email, users_pass FROM login WHERE users_email = $email");
* $row = mysql_fetch_array($result);*
if($row["users_email"]==$email && $row["users_pass"]==$pass)
echo"You are a validated user.";
else
echo"Sorry, your credentials are not valid, Please try again.";
?>
thomale 0 Newbie Poster
broj1 356 Humble servant Featured Poster
broj1 356 Humble servant Featured Poster
thomale 0 Newbie Poster
broj1 356 Humble servant Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.