'Your message', 'type' => 'textarea', 'name' => 'post', 'default' => ''), array('key' => '','type' => 'hidden','name' => 'type', 'default' => $typer), array('key' => '','type' => 'hidden','name' => 'id', 'default' => $idr), array('key' => 'Attachments', 'type' => 'file', 'name' => 'file', 'default' => '') ),'/index.php'); } $qs = parse_url($_SERVER['REQUEST_URI']); if (is_null($qs)) $qs = array('query' => '?'); $qsq = $qs['query']; $qss = array(); parse_str($qsq,$qss); $qss['page'] = $page + 1; $qs_next = http_build_query($qss); $qss['page'] = $page - 1; $qs_prev = http_build_query($qss); ?>
prepare("SELECT * FROM comment WHERE targetType = ? AND targetId = ? ORDER BY date DESC LIMIT ? OFFSET ?"); $stmt->execute([ $typer, $idr, 10, $page * 10 ]); $posts = $stmt->fetchAll(PDO::FETCH_DEFAULT); foreach ($posts as $post) { ?>