suma237 Posted July 7, 2007 Share Posted July 7, 2007 i want to import excel file into mysql database . Thanks Link to comment https://forums.phpfreaks.com/topic/58819-solved-how-to-import-excel-file-to-mysql-database/ Share on other sites More sharing options...
Yesideez Posted July 7, 2007 Share Posted July 7, 2007 First export your Excel database out as a CSV file. You'll then need to wrote a PHP script to read the Excel file and parse the dta and populate the database. Link to comment https://forums.phpfreaks.com/topic/58819-solved-how-to-import-excel-file-to-mysql-database/#findComment-291802 Share on other sites More sharing options...
suma237 Posted July 7, 2007 Author Share Posted July 7, 2007 how to export the Excel database out as a CSV file.? explain me in stepwise manner .please Link to comment https://forums.phpfreaks.com/topic/58819-solved-how-to-import-excel-file-to-mysql-database/#findComment-291803 Share on other sites More sharing options...
Yesideez Posted July 7, 2007 Share Posted July 7, 2007 You can either upload your CSV to the server and read it that way or make a form where you can paste the code in. You can also make an upload form if its something that tyou want to do regularly. Once read you'd use explode() to put each row into an array then populate the table using loop. To Export the CSV in Excel, go to File>Export then select CSV from the filetype box. It'll make a standard text file. Link to comment https://forums.phpfreaks.com/topic/58819-solved-how-to-import-excel-file-to-mysql-database/#findComment-291805 Share on other sites More sharing options...
suma237 Posted July 7, 2007 Author Share Posted July 7, 2007 please help me...i am trying to do this.thanks for your valuable time Link to comment https://forums.phpfreaks.com/topic/58819-solved-how-to-import-excel-file-to-mysql-database/#findComment-291806 Share on other sites More sharing options...
Yesideez Posted July 7, 2007 Share Posted July 7, 2007 Help - how? Link to comment https://forums.phpfreaks.com/topic/58819-solved-how-to-import-excel-file-to-mysql-database/#findComment-291808 Share on other sites More sharing options...
suma237 Posted July 7, 2007 Author Share Posted July 7, 2007 What it means? To Export the CSV in Excel, go to File>Export then select CSV from the filetype box. It'll make a standard text file. i need to import excel sheet into mysql Link to comment https://forums.phpfreaks.com/topic/58819-solved-how-to-import-excel-file-to-mysql-database/#findComment-291809 Share on other sites More sharing options...
Yesideez Posted July 7, 2007 Share Posted July 7, 2007 Yes but first you need to make a CSV file by exporting the Excel file. Once you've made that CSV file as I said earlier... You can either upload your CSV to the server and read it that way or make a form where you can paste the code in. You can also make an upload form if its something that tyou want to do regularly. Link to comment https://forums.phpfreaks.com/topic/58819-solved-how-to-import-excel-file-to-mysql-database/#findComment-291810 Share on other sites More sharing options...
suma237 Posted July 7, 2007 Author Share Posted July 7, 2007 how can i make csv file Link to comment https://forums.phpfreaks.com/topic/58819-solved-how-to-import-excel-file-to-mysql-database/#findComment-291812 Share on other sites More sharing options...
Yesideez Posted July 7, 2007 Share Posted July 7, 2007 In Excel, "File" menu then "Save As..." then from the file requester, "select "Save as type" to be a CSV file. OK here's some questions: 1. How many rows is in your Excel document? 2. Is this a one-off or will you want to do more than one? 3. If more than one, do you want to do this regularly or only once or twice? Link to comment https://forums.phpfreaks.com/topic/58819-solved-how-to-import-excel-file-to-mysql-database/#findComment-291813 Share on other sites More sharing options...
suma237 Posted July 7, 2007 Author Share Posted July 7, 2007 1. How many rows is in your Excel document? more than 400 2. Is this a one-off or will you want to do more than one? i am not able to understand now 3. If more than one, do you want to do this regularly or only once or twice? regularly Doubts--is the file extension is *.csv? Link to comment https://forums.phpfreaks.com/topic/58819-solved-how-to-import-excel-file-to-mysql-database/#findComment-291815 Share on other sites More sharing options...
Yesideez Posted July 7, 2007 Share Posted July 7, 2007 Yes, the file is ".csv" OK for a Excel document having that much data you might want to either upload the CSV file to the server or write an upload script. Once the CSV file is on the server you need to go through it with a loop and explode() the line into an array. From there you can then build an INSERT query for MySQL to insert each row into the database. But that's pretty much what I've already said. Link to comment https://forums.phpfreaks.com/topic/58819-solved-how-to-import-excel-file-to-mysql-database/#findComment-291816 Share on other sites More sharing options...
suma237 Posted July 7, 2007 Author Share Posted July 7, 2007 i saved the excel file as *.csv,but the file is saved as *.csv.xls Link to comment https://forums.phpfreaks.com/topic/58819-solved-how-to-import-excel-file-to-mysql-database/#findComment-291817 Share on other sites More sharing options...
Yesideez Posted July 7, 2007 Share Posted July 7, 2007 Then you haven't saved it out as a CSV file then. Did you select "CSV (Comma delimited) (*.csv)" from the "Save as type" selection box? Link to comment https://forums.phpfreaks.com/topic/58819-solved-how-to-import-excel-file-to-mysql-database/#findComment-291818 Share on other sites More sharing options...
suma237 Posted July 7, 2007 Author Share Posted July 7, 2007 yes i got it...now im trying write a code for upload the csv...thanks a lot Link to comment https://forums.phpfreaks.com/topic/58819-solved-how-to-import-excel-file-to-mysql-database/#findComment-291819 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.