monkeypaw201 Posted May 4, 2008 Share Posted May 4, 2008 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 More sharing options...
DarkWater Posted May 4, 2008 Share Posted May 4, 2008 Missed a ; on this line: $row = mysql_fetch_assoc($result) =/ Line 14 I think. Link to comment https://forums.phpfreaks.com/topic/104081-solved-unexpected-t_variable-on-line-16/#findComment-532816 Share on other sites More sharing options...
monkeypaw201 Posted May 4, 2008 Author Share Posted May 4, 2008 that was it, thanks Link to comment https://forums.phpfreaks.com/topic/104081-solved-unexpected-t_variable-on-line-16/#findComment-532818 Share on other sites More sharing options...
dooper3 Posted May 4, 2008 Share Posted May 4, 2008 Damn! beat me to it! Link to comment https://forums.phpfreaks.com/topic/104081-solved-unexpected-t_variable-on-line-16/#findComment-532819 Share on other sites More sharing options...
DarkWater Posted May 4, 2008 Share Posted May 4, 2008 I win. Link to comment https://forums.phpfreaks.com/topic/104081-solved-unexpected-t_variable-on-line-16/#findComment-532823 Share on other sites More sharing options...
dooper3 Posted May 4, 2008 Share Posted May 4, 2008 You do indeed DarkWater... but not for long. [strikes a pose of heroism and defiance against the rocky outcrop] Link to comment https://forums.phpfreaks.com/topic/104081-solved-unexpected-t_variable-on-line-16/#findComment-532825 Share on other sites More sharing options...
DarkWater Posted May 4, 2008 Share Posted May 4, 2008 I can't believe I just laughed on a PHP forum. D: Link to comment https://forums.phpfreaks.com/topic/104081-solved-unexpected-t_variable-on-line-16/#findComment-532831 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.