Created
May 27, 2020 06:42
-
-
Save Ruekompa/4fd97243f9017dea9c4e7adba5054e16 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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