$query1 = "update rooms set available='1' where typeId='$typeId' order by roomId limit='$room'";
我接近' =' 1''附近的语法错误但我无法找到错误。我很确定它的写得正确。
答案 0 :(得分:1)
LIMIT无法分配值,删除引号。将其更改为:
$query1 = "update rooms set available='1' where typeId='$typeId' order by roomId limit $room";
答案 1 :(得分:1)
在sql限制中无法分配,你不能使用限制数周围的引号,所以使用此
$query1 = "update rooms set available = '1' where typeId = '$typeId' order by roomId limit $room ";
不要使用'$room'
答案 2 :(得分:0)
只需将您的查询更改为:
$query1 = "update `rooms` set available='1' where typeId='$typeId' order by roomId limit '$room'";