1. Use PHP
Excel Parser Pro software, but this software is a paid software;
2. You can save EXCEL tables in CSV format , and then import through phpmyadmin or SQLyog. The SQLyog import method is:
·Save the EXCEL table as CSV format;
·Open SQLyog , right-click the table to be imported, click "Import" - "Import using Load local CSV data";
·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 Up;
Related recommendations: "php introductory tutorial"
Third, a relatively stupid manual method is to use excel to generate sql statements first, and then go to mysql Run, this method is suitable for importing excel tables into various sql databases:
· Assume that your table has three columns of data, A, B, and C, and you want to import them into your database. Table tablename, the corresponding fields are col1, col2, col3.
·Add a column to your table and use excel formulas to automatically generate sql statements. The specific method is as follows:
(1) Add a column (assuming it is column D )
(2) Enter the formula in column D of the first row, which is D1:
=CONCATENATE("insert into tablename (col1,col2,col3) values (",A1, ",",B1,",",C1,");")
(3) At this time, D1 has generated the following sql statement:
insert into table (col1,col2 ,col3) values ('a','11','33');
(4) Copy the formula of D1 to column D of all rows (that is, use the mouse to click and hold the lower right corner of cell D1 Keep dragging it down)
(5) At this time, all sql statements have been generated in column D
(6) Copy column D to a plain text file, assuming it is sql. txt
·Just put sql.txt into the database and run it. You can import it using the command line or run it using phpadmin.
The above is the detailed content of How to save excel data to database in php. For more information, please follow other related articles on the PHP Chinese website!

The article compares ACID and BASE database models, detailing their characteristics and appropriate use cases. ACID prioritizes data integrity and consistency, suitable for financial and e-commerce applications, while BASE focuses on availability and

The article discusses securing PHP file uploads to prevent vulnerabilities like code injection. It focuses on file type validation, secure storage, and error handling to enhance application security.

Article discusses best practices for PHP input validation to enhance security, focusing on techniques like using built-in functions, whitelist approach, and server-side validation.

The article discusses strategies for implementing API rate limiting in PHP, including algorithms like Token Bucket and Leaky Bucket, and using libraries like symfony/rate-limiter. It also covers monitoring, dynamically adjusting rate limits, and hand

The article discusses the benefits of using password_hash and password_verify in PHP for securing passwords. The main argument is that these functions enhance password protection through automatic salt generation, strong hashing algorithms, and secur

The article discusses OWASP Top 10 vulnerabilities in PHP and mitigation strategies. Key issues include injection, broken authentication, and XSS, with recommended tools for monitoring and securing PHP applications.

The article discusses strategies to prevent XSS attacks in PHP, focusing on input sanitization, output encoding, and using security-enhancing libraries and frameworks.

The article discusses the use of interfaces and abstract classes in PHP, focusing on when to use each. Interfaces define a contract without implementation, suitable for unrelated classes and multiple inheritance. Abstract classes provide common funct


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SublimeText3 Linux new version
SublimeText3 Linux latest version

SublimeText3 Chinese version
Chinese version, very easy to use

Atom editor mac version download
The most popular open source editor

SublimeText3 Mac version
God-level code editing software (SublimeText3)