This topic is entitled Import Excel to MySQL Using PHP, I believe that this source code will be a big help to everyone who wanted to Import the Excel/CSV file to MySQL Database using PHP. In this project, I use twitter bootstrap framework for the themes and MySQL Database for storing the imported data from excel file.
Screenshot of this project Import Excel to MySQL Using PHP
Steps how to run this project:
Step 1: Download the Full Source code here: excel source code
Step 2: Extract the downloaded source code and put it in the Document root or in your htdocs folder
Step 3: Create a MySQL Database, Name it as “studentdb“.
Step 4: Create a table, use the query below:
- CREATE TABLE <code>subject</code> (
- <code>SUBJ_CODE</code> varchar(30) NOT NULL,
- <code>SUBJ_DESCRIPTION</code> varchar(255) NOT NULL,
- <code>UNIT</code> double NOT NULL,
- <code>PRE_REQUISITE</code> varchar(30) NOT NULL DEFAULT 'None',
- <code>COURSE_ID</code> int(11) NOT NULL,
- <code>AY</code> varchar(30) NOT NULL,
- <code>SEMESTER</code> varchar(20) NOT NULL
- ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Step 5: Run your project: copy this link to your browser. http://localhost/excel/index.php
In order for you to import the excel file, make sure that the format of excel file is set to CSV. You can use the sample csv file located in your main document folder. Please see the image below for your reference. The file is “subject.csv”.
If you have any questions or suggestion about Import Excel to MySQL Using PHP, Please feel free to contact me at our contact page.
Next Topic: Exporting Record from MySQL database to Excel file Using PHP.
Import Excel to MySQL Using PHP Related Topic:
If you find this article useful, please a comment below and share this with your friends who loves to do programming.