Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
36 lines (27 sloc) 619 Bytes
<h2>Handleliste iLunchWeb</h2>
<?php
$servername = "localhost";
$username = "root";
$password = "root";
$dbname = "db";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT id, task FROM tasks";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo '<li class="item"><span>'. $row["task"].'</span></li>';
}
} else {
echo "0 results";
}
$conn->close();
?>
<script>
print();
</script>