我的代码是
$queryinsert = mysql_query("
INSERT INTO studentdata (offsiteleft)
VALUES ($m_offsiteleft)
WHERE studentid = '$name'
")
or die("Error querying database (Offsite minutes INSERT query) ".mysql_error());
给我这个错误
Error querying database (Offsite minutes INSERT query) 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 studentid = '31'' at line 3
答案 0 :(得分:0)
UPDATE studentdata
SET offsiteleft = $m_offsiteleft
WHERE studentid = '$name'