Skip to content

Instantly share code, notes, and snippets.

@websmith
Created July 12, 2016 16:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save websmith/d8cf5c1ab7094a464c5653181f9305d1 to your computer and use it in GitHub Desktop.
Save websmith/d8cf5c1ab7094a464c5653181f9305d1 to your computer and use it in GitHub Desktop.
<?php
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
else {
$sql = "SELECT `Event_ID`, `Event_Name` FROM `Events_Catalog`";
$result = mysqli_query($conn, $sql);
if (mysqli_num_rows($result) > 0) {
// output data of each row
while($row = mysqli_fetch_assoc($result)) {
$Event_ID = $row['Event_ID'];
echo "<li><a href='event.php?id=".$Event_ID."'>" . $row['Event_Name'] . "</a></li>";
}
}
else {
echo "<h3>Sorry, currently there are no scheduled events.</h3>";
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment