Home  >  Article  >  Backend Development  >  php批量写入怎么实现

php批量写入怎么实现

WBOY
WBOYOriginal
2016-06-13 12:18:391025browse

php批量写入如何实现
这是我的代码,一条可以写入,我想一次批量写入几条,如何实现呢?
name.html

<form id="form1" name="form1" method="post" action="post.php"><br /><input name="name[]" type="text" id="name" value="" size="10" /><br /><input name="name[]" type="text" id="name" value="" size="10" /><br /></form>


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

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

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn