Home  >  Article  >  Backend Development  >  一堆数据如何批量插入数据库?

一堆数据如何批量插入数据库?

WBOY
WBOYOriginal
2016-07-06 13:53:581025browse

做测试用数据,从网上找了一堆名字及IP,要将其存入数据库中该如何做啊?!

回复内容:

做测试用数据,从网上找了一堆名字及IP,要将其存入数据库中该如何做啊?!

我大概给你说一下思路:
1.用php的文件处理函数 逐行读取文件 然后得到一个大数组
2.用foreach循环插入mysql 就OK了

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