Batch import (CSV file) in PHP

xiaoxiao2021-03-06  83

Sometimes the background requires that a large amount of data is imported into the database, such as the query of the computer test score, the data of the phone book is generally stored in Excel. At this time, we can export the data into a CSV file, then pass the following procedure Data can be imported into the database in the background batch. All programs and database structures are all in the package file, click here to download http://home.nuc.edu.cn/~arcow/display.php?id=109 below is just the main program part:

"; Echo $ SQL. "
"; $ db-> query ($ sql) Echo "SQL statement execution is successful!
"; $ SQL = "Insert Into Score (IDCard, Names, Num, SEX, NATION, Score) Values ​​('";} fclose; $ TIME_END = GetMicrotime ); $ TIME = $ TIME_END - $ TIME_START; Echo "program execution time:" $ TIME. "second";

转载请注明原文地址:https://www.9cbs.com/read-104860.html

New Post(0)