is it possible to import say 10 excel files into DB at once?
like in PhpMyAdmin, I go and import each file one by one and they are added as new tables.
is there some kind of php code I can write to take all files in X folder and import them? without selecting them one at a time.
54uydf 1 Junior Poster
Recommended Answers
Jump to PostExcel export files are .csv?
If yes, you can use fgetcsv() php function (erelsgl at gmail dot com 09-May-2011 12:57 post example).
Jump to PostWhen you say all at once, I expect you mean one routine which may contain multiple queries. If so, yes of course it can be done with a loop:
PSEUDOCODE:
$files = array(file1,file2,file3....); foreach($files as $file){ //strip file extension from $file into var $table //read file …
Jump to Postperhaps I could help but would need a sample xls file, I have only worked with csv's to do what you want. It would only have to be 3 or 4 rows long with the header fields and some garbage data. Is it possible to create the xls files as …
Jump to PostWhy frm?
Have you tried any of the suggestions?
You don't need phpmyadmin.
You can change all your xls files into csv and import them easily. You just need to research and code. You've been given all the hints you need to do this - well pretty much.
Good luck …
All 14 Replies
sv3tli0 0 Junior Poster in Training
54uydf 1 Junior Poster
sv3tli0 0 Junior Poster in Training
54uydf 1 Junior Poster
eXpertPHP 0 Newbie Poster
54uydf 1 Junior Poster
54uydf 1 Junior Poster

diafol
sv3tli0 0 Junior Poster in Training
ddymacek 15 Posting Whiz
54uydf commented: can't thank you enough!! +3
54uydf 1 Junior Poster
54uydf 1 Junior Poster

diafol
54uydf 1 Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.