Click here to Skip to main content
15,891,951 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a sqlite database named: db with table named student, columns: name and email. Similarly I have excel file studentdb.xlsx having the similar column name with thousand of rows. I want to read the excel file and import the data into sqlite database through a php script. How to do that?

What I have tried:

I went through PHPExcel library but that was for PHP using mysql
Posted
Updated 28-Feb-17 5:02am

Well, PHPExcel claims to be "A pure PHP library for reading and writing spreadsheet files" hence it should provide you the ability to perform the most difficult part of your task, that is importing data from Excel. The next task, i.e. storing data into the sqlite database, should be simple, since PHP provides all that you need (see the documentation: PHP: SQLite3 - Manual[^]).
 
Share this answer
 
Comments
Maciej Los 27-Feb-17 14:47pm    
5ed!
Hello all Problem is solved! I used the PHPExcel Library to import the rows from xlsx file to sqlite database.I took help from here:

Just replaced the mysql code with my sqlite code.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900