We're a community of 1.1M IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,080,555 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Copying a Csv file from web page to database

Hi I have a Csv file in website and it gets updated every half an hour, I want to copy the csv file to database(Mysql)to visualize it can anyone help.
thnx

2
Contributors
3
Replies
3 Days
Discussion Span
1 Year Ago
Last Updated
4
Views
Question
Answered
rahulroshan
Light Poster
28 posts since Aug 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Do you program?

thines01
Postaholic
Team Colleague
2,433 posts since Oct 2009
Reputation Points: 447
Solved Threads: 408
Skill Endorsements: 7

Yes , I know basics of Php,sql and python

rahulroshan
Light Poster
28 posts since Aug 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Well, you might know that you can open a file on a web server in PHP with fopen

$fileInFile=fopen("http://www.fas.usda.gov/psdonline/download/support_tables/countries.csv", "rb");
   while(!feof($fileInFile))
   {
      $strData = fgets($fileInFile);
      printf($strData);
   }
   fclose($fileInFile);

...then parse the contents and insert into the database

thines01
Postaholic
Team Colleague
2,433 posts since Oct 2009
Reputation Points: 447
Solved Threads: 408
Skill Endorsements: 7
Question Answered as of 1 Year Ago by thines01

This question has already been solved: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page generated in 0.0672 seconds using 2.69MB