// get request params
$last_id = $_POST['last_id'];
$limit = 5; // default value
if (isset($_POST['limit'])) {
$limit = intval($_POST['limit']);
}
// select items for page params
/*
try {
$sql = 'SELECT * FROM items WHERE id > :last_id ORDER BY id ASC LIMIT 0, :limit';
$query = $pdo->prepare($sql);
$query->bindParam(':last_id', $last_id, PDO::PARAM_INT);
$query->bindParam(':limit', $limit, PDO::PARAM_INT);
$query->execute();
$list = $query->fetchAll();
} catch (PDOException $e) {
echo 'PDOException : '. $e->getMessage();