//更改数据
if($_POST['DelUpdBtn'])
{
//获取值
$TidArr=$_POST['optid'];
$urlArr=$_POST['url'];
$typeArr=$_POST['typetext'];
$pingAdrArr=$_POST['pingAdr'];
$pingIpArr=$_POST['pingIp'];
$countArr=count($urlArr);
for($i=0;$i<$countArr;$i++)
{
$Tid2Arr=$TidArr[$i];
//echo $Tid2Arr."<br>";
$url2Arr=$urlArr[$i];
//echo $url2Arr."<br>";
$type2Arr=$typeArr[$i];
$pingAdr2Arr=$pingAdrArr[$i];
$pingIp2Arr=$pingIpArr[$i];
if($url2Arr=="")
{
$errorBuffer.="ip不能为空!<br>";
}
else
{
$updateSql="update ip_website set url='$url2Arr',type='$type2Arr',pingAdr='$pingAdr2Arr',pingIp='$pingIp2Arr' where Tid='$Tid2Arr'";
mysql_query($updateSql)or die('error32'.mysql_error());
echo $updateSql."<br>";
}
}
}
高手帮忙看下为什么echo 出的$updateSql有2个Tid? echo 出的$updateSql的值如下所示:
update ip_website seturl='3.3.3.31',type='3',pingAdr='meigou41',pingIp='meigouip41' whereTid='69'
update ip_website seturl='3.3.3.31',type='3',pingAdr='meigou41',pingIp='meigouip41' whereTid='69'
update ip_website seturl='4.4.4.4',type='0',pingAdr='dianxin',pingIp='dian' where Tid='95'
updateip_website set url='3.3.3.31',type='3',pingAdr='meigou41',pingIp='meigouip41'where Tid='95'
update ip_website seturl='4.4.4.4',type='0',pingAdr='dianxin',pingIp='dian' where Tid='96'