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
https://forums.phpfreaks.com/topic/222777-file-copy/#findComment-1152095
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.