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

php批量写入怎么实现

WBOY
Release: 2016-06-13 12:18:39
Original
1099 people have browsed it

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>
Copy after login


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

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template