OK… I was working on selecting the stations from the TXT file URL included with the original Weather Hack readme, and I got some code that works:
$file = file("https://weather.noaa.gov/data/nsd_cccc.txt");
join('\n',$file);
echo "<select name=\"newuser_noaa_id\">\n";
for($i=0;$i<count($file);$i++) {
$split2 = explode(";",$file[$i]);
if($split2[4] != '') {
echo "<option value=\"".$split2[0]."\">".$split2[3].", ".$split2[4].", ".$split2[5]."</option>\n";
} else {
echo "<option value=\"".$split2[0]."\">".$split2[3].", ".$split2[5]."</option>\n";
}
}
echo "</select>";
As you can see, this code is relativly small and would be MUCH easier to use than the MySQL code… I’m working on implementing this code right now.
Also, I noticed a mistake in your my-hacks.php:
$weather_info = $wpdb->get_row("SELECT * FROM $tablenoaainfo WHERE user_noaa_id = '$noaa_id'");
should be:
$weather_info = $wpdb->get_row("SELECT * FROM $tablenoaainfo WHERE noaa_id = '$noaa_id'");