所以我正在为我的html表单做编辑页面,但是它没有更新数据库,并且总是向我显示错误消息更新失败。我想知道我的代码或查询中是否有任何错误。
这是我的查询
$queryupdate = "Update anno
SET where id = '$no'
and title = '$row' and serial_no = '$no'
and type = '$type' and anno = '$row1' ";
您的查询语法错误:
UPDATE tableName SET columnToModify = newValue WHERE coniditons;
在您的情况下,您没有指定要修改的列并跳转到条件。
你这样做吗?
$queryupdate = "Update anno
SET title = '$row' and serial_no = '$no'
and type = '$type' and anno = '$row1' where id = '$no'
";