You are here: Re: Import from csv file to MySQL « PHP Programming Language « IT news, forums, messages
Re: Import from csv file to MySQL

Posted by chrislive on 09/21/05 06:38

I am at work so I cant give you the code but what you need to do is the
following:

1. upload to a temporary directory (say /temp - this folder will need
to have appropriate access rights)

2. use the file_read funcions (look for tutorials on flat files for all
this)

3. import your data into the DB

4. If successful use unlink($file); to delete OR print error message

Thanks
Chris

Smitro wrote:
> Hi,
>
> I'm in the middle of writing a script to import a csv file into mySQL
> (as apart of a bigger project)
>
> I need to know what are the best steps to go from $_FILES to file().
>
> Once the file is read into an array I should be right. I don't want to
> keep a copy of the file uploaded either, as once it is imported I will
> have no use for it.
>
> I'm not sure, do I copy it store it then use it or is there a faster
> way? Will the temp file be deleted or do I have to delete it?

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация