<html>
<head>
<title>Example for PHP worksheets</title>
<meta http-equiv="Content-Security-Policy" content="default-src localhost:8000" />
</head>
<body>
<div>Hi there!  You asked to view the current visitor's book.</div>
<?php
// Connect to the database.
$db = new SQLite3('example.db');
// Run our query…
$results = $db->query('SELECT * FROM visitors ORDER BY visited;');
// …and write out the results.
while ($row = $results->fetchArray()) {
?>
<div class="visitorrow">
<span class="visittime">
<?php
print($row[0]);
?>
</span>
<span class="visitor">
<?php
print($row[1]);
?>
</span>
<span class="comment">
<?php
print($row[2]);
?>
</span>
</div>
<?php
}
?>
</body>
</html>
