I am getting the following error:
Update 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 'ContactOfficeNo='20045878' WHERE ClientCode='MARI'' at line 2
Now I notice after ClientCode='Mari'
, there is another '?
But my code is as below. I can't seem to find the issue. I've got opening & closing ""
with the update query inside as it should be:
include("../dbinfo.inc.php");
$comm=@mysql_connect(localhost,$username,$password);
$rs=@mysql_select_db($database) or die( "Unable to select database");
$id = $_POST["clientcode"];
$cli = $_POST["clientname"];
$em1 = $_POST["email1"];
$em2 = $_POST["email2"];
$em3 = $_POST["email3"];
$cry = $_POST["currency"];
$occ = $_POST["othercc"];
$mob = $_POST["mobile"];
$dty = $_POST["dtymobile"];
$off = $_POST["office"];
$sql = "UPDATE tbl_client SET ClientName='$cli', ContactEmail#1='$em1', ContactEmail#2='$em2', ContactEmail#3='$em3', Currency='$cry', OtherCCinfo='$occ', ContactMobileNo='$mob', DutyMobileNo='$dty',
ContactOfficeNo='$off' WHERE ClientCode='$id'";