I have a simple php error coming up of which i cannot find the solution to. I inserted in the following code:
<?php
session_start();
require_once '../includes/db.php';
$address1 = $_REQUEST["address1"];
$address2 = $_REQUEST["address2"];
$city = $_REQUEST["city"];
$postcode = $_REQUEST["postcode"];
mysql_query("UPDATE customers SET address1='$address1', address2='$address2', city='$city', postcode='$postcode' WHERE username = '".$_SESSION['username']."')")
or die(mysql_error());
?>
This code gives me the following 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
Line 1 is the following in which i think it has nothing to do with the sql statement:
<?php
session_start();
?>
Thanks everyone! 🙂
Change that line:
to that
You have an extra right parenthesis in the query.