Skip to content

Instantly share code, notes, and snippets.

@anthonycvella
Last active December 14, 2015 00:39
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 anthonycvella/5000282 to your computer and use it in GitHub Desktop.
Save anthonycvella/5000282 to your computer and use it in GitHub Desktop.
<?php
$query = $db->query("SELECT * FROM `schools`", false)->execute();
echo "<label for=\"username\">Home School:</label>";
echo "<select name=\"homeSchool\" class=\"addGameField\">";
if ($db->getTotalRows($query)) {
while ($result = $db->fetch($query)) {
echo "<option value=".$result['schoolID'].">".$result['schoolName']."</option>";
}
echo "</select>";
}
echo "<label for=\"username\">Away School:</label>";
echo "<select name=\"awaySchool\" class=\"addGameField\">";
if ($db->getTotalRows($query)) {
while ($result = $db->fetch($query)) {
echo "<option value=".$result['schoolID'].">".$result['schoolName']."</option>";
}
echo "</select>";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment