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.
#2. Open SQLyog, right-click the table to be imported, and click "Import" - "Import using Load local CSV data".
#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.
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.
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.
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!