View Single Post
freecrm
x10 Lieutenant

freecrm's Avatar

Join Date: May 2008
Posts: 303
Credits: 1,293
freecrm will become famous soon enough
Location: UK

Quote  
09-16-2008, 03:54 PM
Re: Insert records from a local csv file

Quote:
Originally Posted by Scoochi2 View Post
yeah, the csv file will need to be uploaded onto *a* server. Not necessarily your server, any will do so long as your script has the permissions needed to read it.
Once the script is online, you can do something along the lines of the following in order to convert the file into an array in your PHP script:

PHP Code:
$file 'location of file';
$array explode(',',file_get_contents($file)); 
Then, it's as simple as using a foreach to get all values of $array into your database

Alternatively, use a textarea form and get the list from $_POST
Cool - thanks - I'll get back to you when I've done some dev and testing.

P.S. - like the text area option - this will avoid many formatting issues.
__________________
Rich

If you liked this post, please give me +rep or donate credits.

My Site:
Reply With Quote
freecrm is offlineReport Post