我在 PHP 中一次执行大量 ms_sql 查询时遇到问题:
以下是我正在尝试做的简化版本:
$updatesql = "UPDATE Pricing SET Price = '".$_POST['price1']."' WHERE PriceID = 1 ";
$updatesql = "UPDATE Pricing SET Price = '".$_POST['price2']."' WHERE PriceID = 2 ";
$updatesql = "UPDATE Pricing SET Price = '".$_POST['price3']."' WHERE PriceID = 3 ";
$updatesql = "UPDATE Pricing SET Price = '".$_POST['price4']."' WHERE PriceID = 4 ";
$updatesql = "UPDATE Pricing SET Price = '".$_POST['price5']."' WHERE PriceID = 5 ";
$updatesql = "UPDATE Pricing SET Price = '".$_POST['price6']."' WHERE PriceID = 6 ";
$updatesql = "UPDATE Pricing SET Price = '".$_POST['price7']."' WHERE PriceID = 7 ";
$updatesql = "UPDATE Pricing SET Price = '".$_POST['price8']."' WHERE PriceID = 8 ";
$executesql = mssql_query($updatesql);
当我一一浏览它们时,它们都可以工作,但是当我尝试一次全部执行它们时,似乎只有最后一个查询被执行。
我正在尝试做的事情可能吗?任何指示我哪里出错了?抱歉,对 PHP 来说还很陌生。