Home > Backend Development > PHP Tutorial > How to insert a bunch of data into the database in batches?

How to insert a bunch of data into the database in batches?

WBOY
Release: 2016-07-06 13:53:58
Original
1074 people have browsed it

To make test data, I found a bunch of names and IPs from the Internet. How should I store them in the database? !

Reply content:

To make test data, I found a bunch of names and IPs from the Internet. How should I store them in the database? !

I will give you a rough idea:
1. Use PHP’s file processing function to read the file line by line and get a large array
2. Use a foreach loop to insert mysql and it will be OK

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