Machias WA Temperature Page - .$ext TLD detected"; if (strlen($ext)==2 && $ext!="us") { print " - using metric units"; $metric=1; } else { $metric=0; } ?>
Machias, WA Temperature Page
Snohomish County 1895
"; echo mysql_errno().": ".mysql_error()."
"; echo "

"; } if (!mysql_select_db("temp")) { echo "Could not connect to 'web' database!

"; echo mysql_errno().": ".mysql_error()."
"; echo "

"; } if (!($id=mysql_query("select max(time) from temps"))) { echo "Error with query:"; echo mysql_errno().": ".mysql_error()."
"; echo "

"; } $last_time=mysql_result($id,0,0); if (!($id=mysql_query("select date_format(\"$last_time\",\"%h:%i %p\")"))) { echo "Error with query:"; echo mysql_errno().": ".mysql_error()."
"; echo "

"; } $local_time=mysql_result($id,0,0)." Pacific"; echo "Last reading at $local_time:
"; if (!($id=mysql_query("select temp0,temp1,temp2 from temps where time=\"$last_time\""))) { echo "Error with query:"; echo mysql_errno().": ".mysql_error()."
"; echo "

"; } list($crawlspace,$outside,$office)=mysql_fetch_row($id); if ($metric==1) { $crawlspace=round((($crawlspace-32)*500)/9)/100; $outside=round((($outside-32)*500)/9)/100; $office=round((($office-32)*500)/9)/100; if ($outside<0) echo "Crawlspace: $crawlspace°C | Outside: $outside°C | Office: $office°C\n"; else echo "Crawlspace: $crawlspace°C | Outside: $outside°C | Office: $office°C\n"; } else { if ($outside<32) echo "Crawlspace: $crawlspace°F | Outside: $outside°F | Office: $office°F\n"; else echo "Crawlspace: $crawlspace°F | Outside: $outside°F | Office: $office°F\n"; } ?>

Outside >°F Minutes
Hours
Crawlspace     Office >°C Days
Weeks

Click here for a weather forecast.



How does this work?