Created
July 8, 2015 04:04
-
-
Save anonymous/219d65c81d5f80e4090a to your computer and use it in GitHub Desktop.
incidents
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
<html> | |
<head> | |
<title>Incidents</title> | |
</head> | |
<body> | |
<h1>Incidents</h1> | |
<?php | |
$link = mysqli_connect('158.69.21.149', 'root', 'JXHzcS1F97PUVB5z3p35m5LH', 'db); | |
$result = $link->query("SELECT subject, time, details FROM incidents WHERE time > DATE_SUB(NOW(), INTERVAL 30 DAY) ORDER BY id DESC LIMIT 20"); | |
$foundAny = false; | |
while($row = mysqli_fetch_array($result)) { | |
$foundAny = true; | |
echo "<h2>{$row['subject']} ({$row['time']})</h2>"; | |
echo "<p>{$row['details']}</p>"; | |
} | |
if(!$foundAny) { | |
echo "<b>There have not been any incidents in the last thirty days.</b>"; | |
} | |
?> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment