我試圖改變與PHP數據庫條目,但仍堅持這一錯誤消息 「在您的SQL語法錯誤」:MySQL的
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 'Bjelkholm Lövgren AND adress = Brinellgatan 14 AND postnummer = 57135 ' at line 1
代碼:
$namn = sanitize($_GET['namn']);
$adress = sanitize($_GET['adress']);
$postnummer = sanitize($_GET['postnummer']);
$postort = sanitize($_GET['postort']);
$email = sanitize($_GET['email']);
$status = 0;
$sql="UPDATE ordrar SET namn = $namn AND adress = $adress AND postnummer = $postnummer
AND postort = $postort AND email $email AND status = $status WHERE email = $email";
if (!mysql_query($sql))
{
die('Error: ' . mysql_error());
}
謝謝尋求答案。 /維克托
是什麼消毒()函數呢? – 2010-07-13 03:34:26
上校彈片,清除從惡代碼中的變量。 – 2010-07-13 04:35:17
恐怕沒有「惡碼」進行清潔。也許,這個函數不需要的東西和無用的。 – 2010-07-13 04:39:20