I am still getting that error when I run my code. Here is my code.I removed all white spaces as well.my form on my html goes to my php (action="lib/login.php") file to check if user exists. If it exist, then redirect. dbconnect.php just connects to my database. can anyone help?
FOLDER Layout:
lib
-dbconnect.php
-login.php (code located below)
index.html
<?php
require_once("dbconnect.php");
$loginuser = $_POST['username'];
$loginpw = $_POST['password'];
$usertable = "Users";
$users="Username";
$pw="Password";
$query = "SELECT $users, $pw FROM $usertable WHERE $users='$loginuser' AND $pw='$loginpw'";
$result = mysql_query($query);
$num_rows = mysql_num_rows($result);
if (!$result) {
die('Invalid query: ' . mysql_error());
}
if ($num_rows>0) {
header("Location:../index.html");
exit();
}
?>