Home  >  Article  >  Backend Development  >  How to import excel data in php

How to import excel data in php

王林
王林Original
2019-10-08 10:15:016999browse

How to import excel data in php

1. You can save the EXCEL table in CSV format, and then import it through phpmyadmin or SQLyog. The SQLyog import method is: save the EXCEL table in CSV format.

How to import excel data in php

#2. Open SQLyog, right-click the table to be imported, and click "Import" - "Import using Load local CSV data".

How to import excel data in php

#3. In the pop-up dialog box, click "Change...", select "Fill in excel-friendly values", and click OK. Select the CSV file path to be imported in "Import from file" and click "Import" to import the data into the table.

How to import excel data in php

4. A relatively stupid manual method is to first use excel to generate sql statements, and then run them in mysql. This method is suitable for importing excel tables into various types of sql database.

How to import excel data in php

5. Suppose your table has three columns of data: A, B, and C. You want to import the table tablename into your database. The corresponding fields are col1, col2, col3.

How to import excel data in php

Recommended tutorial: PHP video tutorial

The above is the detailed content of How to import excel data in php. For more information, please follow other related articles on the PHP Chinese website!

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