Last active
October 2, 2017 11:21
-
-
Save asathoor/4c3253ae54b4c0e438b2e8d2cd8d6d96 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
<?php | |
/* | |
file: actors.php | |
purpose: a list of actors from the sakila database | |
*/ | |
//require_once 'header.php'; // html header | |
require 'db.php'; // the mysqli object | |
$sql = "SELECT * FROM `holdliste`"; | |
$result = $mysqli->query($sql); // query | |
?> | |
<h2>Actors</h2> | |
<?php | |
// looping out the result | |
while($row = $result->fetch_assoc()){ | |
echo $row['hold_navn'] . " " . $row['navn'] . "<br>"; | |
} | |
mysqli_close($mysqli); | |
//require_once 'footer.php'; // html footer | |
?> |
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
<?php | |
/* | |
file: actors.php | |
purpose: a list of actors from the sakila database | |
*/ | |
require_once 'header.php'; // html header | |
require 'db.php'; // the mysqli object | |
$sql = "SELECT * FROM `holdliste`"; | |
$result = $mysqli->query($sql); // query | |
?> | |
<h2>Holdliste</h2> | |
<?php | |
// looping out the result | |
echo "<table>\n"; | |
while($row = $result->fetch_assoc()){ | |
echo "<tr><td class='roed'>" . $row['hold_navn'] . "</td><td>" . $row['navn'] . "</td></tr>\n"; | |
} | |
echo "</table>\n"; | |
mysqli_close($mysqli); | |
require_once 'footer.php'; // html footer | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment