Jump to content

File Copy


sanchez77

Recommended Posts

hey guys, feel asleep last night, my hosting company is yahoo.

 

I am trying to open a text file on NOAA servers, read it, put data into a table and then display the information. It was working fine and then they stopped it.

 

This is the code I was using , now I need a new solution.

 


$wx = array_map('trim',file("http://www.ndbc.noaa.gov/data/realtime2/BRBN4.txt"));
$newwx = array();
foreach($wx as $i => $line) {
   if ($i > 1 && $i <  {
        $tmp = array_filter(explode(' ',$line));
        $q = "insert into brbn4 (year,month,day,hour,min,wdir,wspd,gst,waveht,dpd,apd,mwd,pres,atmp,wtmp,dewp,vis,ptdy,tide) values ('" . implode("','",$tmp) . "')";
        $rw = mysql_query($q) or die("Problem with the query: $q<br>" . mysql_error());
   }
}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.