I am getting users to enter their email and passwords, and with those details I wish to echo their username from the table. This is so I can demonstrate that I have retrieved a value from the table.
I do know that my query works on phpmyadmin and that the email and password is being retrieved in my php as well. The error I am getting with my current code is HTTP Error 500:
mysql_connect($database,$username,$password);
@mysql_select_db($username) or die ("Unable to select database");
$email = mysql_escape_string ($_POST['email']);
$password = mysql_escape_string ($_POST['password']);
$email = stripslashes($email);
$password = stripslashes($password);
$email = mysql_escape_string($email);
$password = mysql_escape_string($password);
$SQL = "SELECT Name FROM users WHERE BINARY Email = '$email' and BINARY password = '$password'";
$result = mysql_query($SQL) or die("Unable to Run Query");
$value = mysql_fetch_object($result) or die("Unable to Fetch Object");
echo "<h2>$value</h2>" or die("Unable to Echo");