<html>
<head>
<title>Example for PHP worksheets</title>
</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(htmlspecialchars($row[0]));
?>
</span>
<span class="visitor">
<?php
print(htmlspecialchars($row[1]));
?>
</span>
<span class="comment">
<?php
print(htmlspecialchars($row[2]));
?>
</span>
</div>
<?php
}
?>
</body>
</html>
