用一个隐藏的input的value保存所有的$records->pmenu_id的值,中间用分隔符(如,)分开,然后与form一起传到处理页,再先得到隐藏input的值,并将其分离保存在数组中,然后你就可以用$_POST处理得到的每个$records->pmenu_id的value,并存入数据库

解决方案 »

  1.   

    谢谢,Huo789 得到的Html是这样的:
    <form name=...     >
    ...
    <td> name1</td>
    <input name="15_gc" type="text" ...
    <input name="15_rc" type="text" ...
    <input name="15_ec" type="text" ...
    ...
    <td> name2 </td>
    <input name="16_gc" type="text" ...
    <input name="16_rc" type="text" ...
    <input name="16_ec" type="text" ...
    ...
    ...
    <td> name25 </td>
    <input name="25_gc" type="text" ...
    <input name="25_rc" type="text" ...
    <input name="25_ec" type="text" ...
    ...每一次插入 序号 $_POST['*'], 还有 $_POST['*_gc'] ,$_POST['*_rc'],$_POST['*_ec'] 是一一对应的!
      

  2.   

    $data=array();
    foreach($_POST as $k=>$v){
    $a=explode('_', $k);
    $data[$a[0]][$a[1]]=$v;
    }
    print_r($data);
      

  3.   

    有点晕了,神仙!@每个序号是插入一条记录
    1  15  15gc  15rc  16ec
    2  16    16gc  16rc  16ec
    ...