while ($row1=mysql_fetch_object($result1)){?><input type="text" name="id_<? echo $row1->id;>" value="<?=$row1->id?>" >
<input type="text" name="prg_file_<? echo $row1->id;>" value="<?=$row1->prg_file?>"
<input type="text" name="for_path_<? echo $row1->id;>" value="<?=$row1->for_path?>"
<input type="text" name="to_path_<? echo $row1->id;>" value="<?=$row1->to_path?>"
<?}?>处理的时候循环取得数据,进行插入。。
<input type="text" name="prg_file_<? echo $row1->id;>" value="<?=$row1->prg_file?>"
<input type="text" name="for_path_<? echo $row1->id;>" value="<?=$row1->for_path?>"
<input type="text" name="to_path_<? echo $row1->id;>" value="<?=$row1->to_path?>"
<?}?>处理的时候循环取得数据,进行插入。。
$result1=mysql_query("select id,prg_file,for_path,to_path from mxp_prg where apply_id=$apply_id");
while ($row1=mysql_fetch_object($result1)){
$id=$row1->id; ?>
<input type="text" name="id" value="<?=$row1->id?>" >
<input type="text" name="prg_file_<?=$id?>" value="<?=$row1->prg_file?>"
<input type="text" name="for_path_<?=$id?>" value="<?=$row1->for_path?>"
<input type="text" name="to_path_<?=$id?>" value="<?=$row1->to_path?>"
<?}?>更新语句:
......
[这里循环怎么写????]
......
$result2=mysql_query("update mxp_prg set prg_file='$prg_file',for_path='$for_path',to_path='$to_path' where id='$id'");
<input type="text" name="prg_file[]" value="<?=$row1->prg_file?>"
<input type="text" name="for_path[]" value="<?=$row1->for_path?>"
<input type="text" name="to_path[]" value="<?=$row1->to_path?>"
<?}?>
foreach($_POST['id'] as $id){
$sql.="update ...... where id=$id;";
}