open('comments.db'); } } if (isset($_POST['user'], $_POST['comment'])) { $user = $_POST['user']; $comment = $_POST['comment']; $db = new MyDB(); $sql = 'INSERT INTO Comments VALUES(\'' . $user . '\',\'' . $comment . '\')'; $ret = $db->exec($sql); $db->close(); } echo 'Comments' . '

Comments

'; $db = new MyDB(); $sql = 'SELECT * FROM Comments'; $ret = $db->query($sql); while ($row = $ret->fetchArray(SQLITE3_ASSOC)) echo '

' . $row['user'] . ' says:
' . $row['comment'] . '

'; $db->close(); echo '

Add comment

' . '
' . '
' . '
' . '
'; ?>