当前位置: 代码迷 >> PHP >> php批量写入怎么实现
  详细解决方案

php批量写入怎么实现

热度:72   发布时间:2016-04-28 17:33:16.0
php批量写入如何实现
这是我的代码,一条可以写入,我想一次批量写入几条,如何实现呢?
name.html
<form id="form1" name="form1" method="post" action="post.php">
<input name="name[]" type="text" id="name" value="" size="10" />
<input name="name[]" type="text" id="name" value="" size="10" />
</form>


post.php
$arr=array();
$arr['name']=trim($_GET['name']);
$arr = daddslashes($arr);
insert('data',$arr,true);

------解决思路----------------------
name后面加个数字
php用for循环读取
------解决思路----------------------
把insert into table values(1),(2),(3)        中的1、2、3放到数组里  一次插入
  相关解决方案