merck_delmoro Posted May 8, 2009 Share Posted May 8, 2009 may I know how to copy the records in excel to mysql??? PHP script Link to comment https://forums.phpfreaks.com/topic/157433-how-to-copy-the-records-in-excel-to-mysql/ Share on other sites More sharing options...
trq Posted May 8, 2009 Share Posted May 8, 2009 see here. Link to comment https://forums.phpfreaks.com/topic/157433-how-to-copy-the-records-in-excel-to-mysql/#findComment-829929 Share on other sites More sharing options...
Mark Baker Posted May 9, 2009 Share Posted May 9, 2009 may I know how to copy the records in excel to mysql??? PHP script Start by taking a look at PHP Libraries capable of reading Excel files, such as PHPExcel Link to comment https://forums.phpfreaks.com/topic/157433-how-to-copy-the-records-in-excel-to-mysql/#findComment-830171 Share on other sites More sharing options...
kel Posted May 9, 2009 Share Posted May 9, 2009 if your files aren't too big, you could also go for the option of sticking your data into say a text file and then running a command in mysql to import that data (make sure that your data is formatted correctly e.g. no blank lines etc) i believe the command is: load data local infile "pathname/filename.txt" INTO table tablename lines terminated by "\r\n"; the last bit just puts a carriage return in etc. It may not be suitable, but is fairly straight forward Link to comment https://forums.phpfreaks.com/topic/157433-how-to-copy-the-records-in-excel-to-mysql/#findComment-830176 Share on other sites More sharing options...
juma929 Posted May 9, 2009 Share Posted May 9, 2009 Hey, I normally just convert the excel sheet to a CSV and import manually using a tool such as PHPMYADMIN. If you need to do it more often, consider uploading the excel document to the server and create some code to open and use the excel sheet. I would personally import the excel sheet as XML and handle that way. Justin Link to comment https://forums.phpfreaks.com/topic/157433-how-to-copy-the-records-in-excel-to-mysql/#findComment-830184 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.