if (!intval($_GET['p'])) $_GET['p']=0; include($_SERVER['DOCUMENT_ROOT'].'dbinfo.php'); $mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME); if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $p = intval($_GET['p']); $num = 50 * $p; $stmt = $mysqli->prepare("SELECT id,date,name,text FROM guestbook ORDER BY id DESC LIMIT ?,50"); $stmt->bind_param('i', $num); $stmt->execute(); $stmt->bind_result($id, $date, $name,$text); echo("
${date} | ${name} | ${text} |