diff --git a/docs/index.php b/docs/index.php index 16b242b..6ed9c45 100644 --- a/docs/index.php +++ b/docs/index.php @@ -28,6 +28,8 @@ page_header(); $form_message = post_handler(); + + $page = array_key_exists('page',$_GET) ? ($_GET['page']) : 0; ?>
- 'Your message', 'type' => 'textarea', 'name' => 'post', 'default' => '') )); } - - $stmt = $db->prepare("SELECT * FROM comment ORDER BY date DESC"); - $stmt->execute([]); +?> + + + +prepare("SELECT * FROM comment ORDER BY date DESC LIMIT ? OFFSET ?"); + $stmt->execute([ + 10, + $page * 10 + ]); $posts = $stmt->fetchAll(PDO::FETCH_DEFAULT);