SQL SYNTAX CHEKCER
if (isset($_POST['submit']))
{
$email = $_POST['txtemail'];
$password = $_POST['txtpwd'];
$sql = mysqli_query($conn,"SELECT * FROM user WHERE email='$email' and password='$password'");
echo "SELECT * FROM user WHERE email='$email' and password='$password'";
if(!$sql){
printf("Error: %s\n", mysqli_error($conn));
exit();
//header("location:home.php");
}
$sql_data = mysqli_fetch_assoc($sql);
print_r($sql_data);
if (!empty($sql_data)){
$_SESSION["txtemail"] = $sql_data['txtemail'];
$_SESSION["txtname"] = $sql_data['txtname'];
$_SESSION["txtpwd"] = $sql_data['txtpwd'];
//while($row = mysqli_fetch_array($conn,$sql_data))
header("location:home.php");
}
}
Tapan Agrawal