Jump to content

[SOLVED] unexpected T_VARIABLE on line 16


monkeypaw201

Recommended Posts

i am getting the error unexpected T_VARIABLE when i try to run this code:

 

<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_bluesky = "localhost";
$database_bluesky = "my_db";
$username_bluesky = "user";
$password_bluesky = "pass";
$bluesky = mysql_pconnect($hostname_bluesky, $username_bluesky, $password_bluesky) or trigger_error(mysql_error(),E_USER_ERROR); 

mysql_select_db($database_bluesky,$bluesky);
$result = mysql_query("SELECT * FROM weather WHERE icao = '$_GET[icao]'");
$row = mysql_fetch_assoc($result)

/* THis is for the short metars*/
$file = file("ftp://tgftp.nws.noaa.gov/data/observations/metar/stations/".$row['icao'].".TXT");

if($file)
mysql_query("UPDATE weather SET raw = '".$file[1]."' WHERE icao = '".$row['icao']."'", $bluesky);
else
mysql_query("UPDATE weather SET raw = '[Not Available]' WHERE icao = '".$row['icao']."'", $bluesky);

/* THis is for the long metars*/
$file = file("ftp://tgftp.nws.noaa.gov/data/observations/metar/decoded/".$row['icao'].".TXT");

if($file)
{
$decrypt = NULL;
foreach ($file as $v)
{
$decrypt .= $v."**";
}
mysql_query("UPDATE weather SET decoded = '".$decrypt."' WHERE icao = '".$row['icao']."'", $bluesky);
}
else
{
mysql_query("UPDATE weather SET decoded = '[Not Available]' WHERE icao = '".$row['icao']."'", $bluesky);
}

Link to comment
https://forums.phpfreaks.com/topic/104081-solved-unexpected-t_variable-on-line-16/
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.