Hi Leute, ich hab hier son Script gemacht und find und find den Fehler einfach nicht raus:
$sqlEditCustomer = "UPDATE tblCustomer SET
Name = '".htmlspecialchars($_POST['inptName'])."',
Country = '".htmlspecialchars($_POST['inptCountry'])."',";
if ($_POST['inptServer'] == '0')
$sqlEditCustomer .= "Fk_ServerId = NULL";
else
$sqlEditCustomer .= "Fk_ServerId = '".$_POST['inptServer']."'";
$sqlEditCustomer .= "WHERE tblCustomer.Id = '".$_GET['customerid']."'";
mysql_query($sqlEditCustomer) OR die(mysql_error());
Wenn nun inptServer == '0' ist kommt immer dieser Fehler:
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 'WHERE tblCustomer.Id = '4'' at line 3
Wenn der Server gesetzt wird geht allerdings alles...
Kann mir jemand helfen?
Gruss vom LoL