Link to home
Start Free TrialLog in
Avatar of hydrazi
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?
Avatar of shobinsun
shobinsun
Flag of India image

Avatar of kingofnines
kingofnines

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
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
ASKER CERTIFIED SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of hydrazi

ASKER

Awesome!  Thank you
Thanks for the points!  It's a good question. ~Ray