【发布时间】:2014-05-19 01:41:55
【问题描述】:
当运行下面的代码时,在第二个循环中(它循环的次数)它给了我一个命令不同步错误。这是什么原因造成的?
PHP 代码:
while ($i < $quantity) {
$result = mysqli_multi_query($con, "
INSERT INTO parts (capacity, length, width, height, orientation, weight, location, description, status, partNumber) VALUES ('$capacity', '$length', '$width', '$height', '$orient', '$weight', '$location', '$desc', '$status', '$partNum');
INSERT INTO craneparts (craneID, partsID) VALUES ('$craneID', LAST_INSERT_ID());
") or die(mysqli_error($con));
$i++;
}
【问题讨论】:
-
哇!不知道有
mysqli_multi_query...要学的东西太多 -
我知道!我今天早些时候才知道。在我遇到需要它之前,我什至不会考虑这种可能性。