hi... i am doin a project .. i want to know how to import data to mysql database from excel sheet and vice versa using php coding......... please guide me through this...... thank u
excell to mysql
Collapse
X
-
Hi. Welcome to The Scripts!
What you need to do that is an Excel parser. A program to convert an Excel formated file into... whatever format you need it to be. XML I suppose.
You will need to either write this yourself or find a pre-made program to do this for you. Google is a good place to start searching ;)
If you choose to write it yourself, you will need to get to know the internals of an Excel formated file. That will be the biggest challenge. -
Heya, Sandeep. Welcome to TSDN!
If it is practical to export your Excel file as a CSV, you can import the file using MySQL's built-in LOAD DATA INFILE command.Comment
-
You can also use ODBC to read an Excel file and also to create a new Excel file.
You can open the Excel file similar to how you would open a MySQL connection.
[code=php]
odbc_connect("D river={Microsof t Excel Driver(*.xls)}; Dbq=C:\filename .xls;");
[/code]
From there you would use the ODBC database commands to read or write to the Excel file.Comment
Comment