Garnet Lake Monitor
";
$servername = "gator3185.hostgator.com";
$username = "garneake_jws";
$password = "jws123";
$dbname = "garneake_lakedata";
// Create connection
$con = mysqli_connect($servername, $username, $password, $dbname);
if (mysqli_connect_errno()) {
echo "Unable to connect to database.";
echo "Error: " . mysqli_connect_error();
exit();
}
$sql = "SELECT * FROM SensorData WHERE Height LIKE 'R%' ORDER BY DateTime DESC LIMIT 1";
$result = mysqli_query($con, $sql,MYSQLI_STORE_RESULT);
//echo("SELECT Status: " . mysqli_error($con) . ""); if ($result = mysqli_query($con, $sql)) { // Fetch one and one row while ($row = mysqli_fetch_row($result)) { sscanf($row[1], "R%d", $meas); $meas = round($meas/2.54); $meas = 58-$meas; echo "
The height of the lake is " . $meas . "'' above the bottom of the culvert.
";
//echo "The Lake Monitor is off-line for repair, displayed height is not actual.
";
}
mysqli_free_result($result);
}
echo "The height of the Auxiliary Spillway is approximately 24'' above the bottom of the culvert."; ?>