Skip to content

Instantly share code, notes, and snippets.

@Ruekompa
Created May 27, 2020 06:42
Show Gist options
  • Save Ruekompa/4fd97243f9017dea9c4e7adba5054e16 to your computer and use it in GitHub Desktop.
Save Ruekompa/4fd97243f9017dea9c4e7adba5054e16 to your computer and use it in GitHub Desktop.
<!DOCTYPE HTML>
<html lang="en">
<head>
<title>Hernando County's latest COVID stats</title>
</head>
<body>
<?php
require "config.php";
try {
$connection = new PDO($dsn, $username, $password, $options);
}
catch(PDOException $error) {
echo "Cannot connect to database. Fix that." . "<br>" . $error->getMessage();
}
$sql = $connection->query("SELECT id, confirmed, deaths FROM hernando GROUP BY id, confirmed, deaths ORDER BY id DESC LIMIT 0, 1;")->fetchAll();
foreach ($sql as $row) {
echo $row['confirmed']."<br>";
echo $row['deaths']."<br>";
}
?>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment