Getting this error, You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
Getting the above error from this, I'm new to PHP so I have no idea what the problem could be, any help?
<?php
session_start();
//ob_start();
//make connection
$con = mysql_connect ("***" , "***", "***")
or die ("Query died: connect");
mysql_select_db("*****",$con);
// Grab User submitted information
$user = $_POST["myuser"];
$pass = $_POST["mypwd"];
strong text$result = mysql_query("SELECT FirstName, Password FROM memberst WHERE FirstName = $user");
if (!$result) { // add this check.
die('Invalid query: ' . mysql_error());
}
$row = mysql_fetch_array($result);
if($row["Firstname"]==$user && $row["Password"]==$pass) {
echo $row["Firstname"];
//header("location:LoginSuccess.php");
}
else {
echo"Sorry, your credentials are not valid, Please try again.";
}`enter code here`
?>