hydrazi
asked on
CSV Import to MySQL through PHP
I love PHPMyAdmin, but I want something a little more "secure" that I can setup for an average user. Even something that will import a file from the same location over and over by pressing a button.
The file is CSV file with one strange twist. One field has several filenames separated by | though like I said, it is a single field called attachments.
Anyone know of any software or good script to modify that could provide this functionality?
The file is CSV file with one strange twist. One field has several filenames separated by | though like I said, it is a single field called attachments.
Anyone know of any software or good script to modify that could provide this functionality?
it is a fairly easy proccess to parse a CSV file into its seperate fields and then upload them to a table. Take a look at the explode() function...
http://us3.php.net/manual/en/function.explode.php
Using explode() you can parse your CSV record into an array. Then traverse the array in a loop and build your upload statement. Post a sample of your file and I will write a quick example script.
Alan
http://us3.php.net/manual/en/function.explode.php
Using explode() you can parse your CSV record into an array. Then traverse the array in a loop and build your upload statement. Post a sample of your file and I will write a quick example script.
Alan
The second article shobinsun gave you is an example of what I was saying. I didn't see he had posted before I posted.
Alan
Alan
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Awesome! Thank you
Thanks for the points! It's a good question. ~Ray
look at the following:
http://www.modwest.com/help/kb.phtml?qid=253&cat=6
http://www.legend.ws/blog/tips-tricks/csv-php-mysql-import/
This will help you.
Regards