Maison > Article > développement back-end > 多行数据组合数组有关问题~真心不会组合了,求教导
多行数据组合数组问题~~,真心不会组合了,求教导!
类似上面的表单,还没加js,不一定多少行,我要做的是每行一条数据写入数据库。这个数组我就不会组合了
我表单里是如下设置的:
<br /> <table width="100%" border="0" cellspacing="0" cellpadding="0"><br /> <tr><br /> <td><br /> 品名:<input name="pinming[]" type="text" value=""><br /> 型号:<input name="xinghao[]" type="text" value=""><br /> 规格:<input name="guige[]" type="text" value=""><br /> 数量:<input name="shuliang[]" type="text" value=""><br /> 单价:<input name="danjia[]" type="text" value=""><br /> 总价:<input name="zongjia[]" type="text" value=""><br /> </td><br /> </tr><br /> <tr><br /> <td><br /> 品名:<input name="pinming[]" type="text" value=""><br /> 型号:<input name="xinghao[]" type="text" value=""><br /> 规格:<input name="guige[]" type="text" value=""><br /> 数量:<input name="shuliang[]" type="text" value=""><br /> 单价:<input name="danjia[]" type="text" value=""><br /> 总价:<input name="zongjia[]" type="text" value=""><br /> </td><br /> </tr><br /> <br /> </table><br />
<br> array<br> 'pinming' => <br> array<br> 0 => string '123' (length=3)<br> 1 => string '123' (length=3)<br> 'xinghao' => <br> array<br> 0 => string '123' (length=3)<br> 1 => string '123' (length=3)<br> 'guige' => <br> array<br> 0 => string '123' (length=3)<br> 1 => string '123' (length=3)<br> 'shuliang' => <br> array<br> 0 => string '123' (length=3)<br> 1 => string '123' (length=3)<br> 'danjia' => <br> array<br> 0 => string '123' (length=3) <div class="clear"> </div>