Hey guys,
I'm new to php so I need some help trying to update a column in my SQL database. What I'm doing is using GET to try to update my database. The database is 5 colums and I'm trying to update the last one and I get an error saying 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
The 1st colume is the DATE they signed up, the 2nd is FirstName, the 3rd is LastName, the 4th is UserName, and the 5th is PassWord.
Now I'm able to see all the information I send through the link but I still having issue's with the syntax.
Here is what my code looks like
<?php
$con = mysql_connect("HOST","USERNAME", "PASSWORD");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("DATABASENAME", $con);
$FN = $_GET["FirstName"];
$LN = $_GET["LastName"];
$PW = $_GET["PassWord"];
mysql_query("UPDATE users SET PassWord= $PW
WHERE MID = $FN AND LastName = $LN") or die(mysql_error());
mysql_close($con);
?>
Any help on this would be much appreciated.