I have an sql syntax error for some database code i'm trying to query for a login system. I'm assuming it has something to do with the way i'm using quotations (double/single) in my query statement which I'm not getting right. If someone could reply back with the correct use of quotations in my sql statement i would appreciate it.
Here is the part of the code:
if(isset($_POST['submit']))
{
//get user input
$firstname = secure($_POST["firstname"]);
$lastname = secure($_POST["lastname"]);
$email = secure($_POST["email"]);
//check if fields are empty
if(empty($firstname) || empty($lastname) || empty($email))
{
die('You must fill all form fields in.');
}
$sql = 'UPDATE register SET
firstname="' .$firstname. '",
lastname="' .$lastname. '",
email="' .$email. '",
WHERE id="' . $_SESSION['id'] . '"';
Thanks for any help in advance