Forum Moderators: coopster

Message Too Old, No Replies

How to dump a FTP download into mySQL

         

dak142

10:34 pm on Mar 23, 2004 (gmt 0)

10+ Year Member



I am working with datafeeds, here is what I am attempting to do. I am connecting to a FTP site using PHP, that was easy. Now that I am connected, what do I have to do to get a file from that site into a mySQL database. I understand basic PHP and mySQL, I have been teaching myself over the last month or so. What command sequence will I need to accomplish this task? I just need to get pointed in the right direction. Any help will be greatly appreciated.

Regards,
David

Nova Reticulis

4:07 pm on Mar 24, 2004 (gmt 0)

10+ Year Member



Obtain the contents of the file, whichever is the method you use. If you use fopen() with URL wrappers, use fgets(), fread() or whatever suits you. If you use external tools like ncftpget, act accordingly. If you use PEAR classes (if there are any), act accordingly.

Once you got a variable with the data, insert it with you r favourite data insertion method :)

And don't forget to escape!