How to import an excel sheet to MYSQL database?

A

Anonymous

Guest
I don't know if that possible and if it is possible can you explan to me how?
If you have any tutorials would be great
 
I use folowing : try this

First delete sheets 2 & 3. Save excel sheet as .csv file
An excel .csv must contain only one sheet with data.

And write code
like

$sql = "LOAD DATA INFILE 'csvfilepath' INTO TABLE tablename FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'";
mysql_query($sql);
 
you can do it manually.first you must copy datas to access database then you can import it to mysql. to copy datas to access database; first you should set the colunms in the access database created by you.then you copy (ctrl-c) the all data in excel file.then come to access and view it as design view. after that select all column lines by pressing shift simply. then paste it(ctrl-v).access will ask you if you wanted to add 100(for ex.) records or not. you will say yes then datas will be loaded into access database. when you will save it and close you can import to mysql.i think you know how to import access files to mysql.i hope i could explain. this is another way. i always do it.
 
I heared there is another way but unfortunately I've no clear idea abt that. U can write vb code to copy all the cell value to one cell and the output of the cell looks like this "insert into db_name() values('cell1.value','cell2.value'........); then execute the command in mysqladmin. Thats it...
 
Back
Top