$cd=$_POST['cd'];
$iid=$_POST['iid'];//有
$pm=$_POST['pm'];
.... for($i=0;$i<count($cd);$i++)
{
$SQL='update $table set cd="'.$_POST['cd'].'" where iid='.$iid;
...
}
for($j=0;$j<count($pm);$j++)
{
$SQL='update $table set pm="'.$_POST['pm'].'" where iid='.$iid;
...
}
.....
$iid=$_POST['iid'];//有
$pm=$_POST['pm'];
.... for($i=0;$i<count($cd);$i++)
{
$SQL='update $table set cd="'.$_POST['cd'].'" where iid='.$iid;
...
}
for($j=0;$j<count($pm);$j++)
{
$SQL='update $table set pm="'.$_POST['pm'].'" where iid='.$iid;
...
}
.....
for($i=0;$i<$cnt;$i++)
{if(isset($pm[$i]))
{
update pm;
}if(isset($cm[$i]))
{
update cm;
};
;
;
}
for($i=0;$i<$cnt;$i++)
{if(isset($pm[$i]))
{
update pm;
}if(isset($cm[$i]))
{
update cm;
}:
:
:
}
其中$cnt;为数组中元素的个数,可以从提交的页面得出来,也可以通过count出来。
$iid=$_POST['iid'];//有
$pm=$_POST['pm'];
.... for($i=0;$i<count($cd);$i++)
{
$SQL="update $table set cd='$cd[$i]' where iid='$iid'";
...
}
for($j=0;$j<count($pm);$j++)
{
$SQL="update $table set pm='$pm[$j]' where iid='$iid'"; ...
}
.....
xuzuning(唠叨) 大哥是列样么??