Если вы используете PDO для выполнения запроса MySQL, вы можете создать переменную в PHP, а затем ограничить ваш запрос этой переменной.
вот неполный пример, но вы можете понять идею.
<?php
$first = 0;
$second = 9;
$stmt = $db->prepare('select username from users limit :first, :second');
$stmt->bindParam(':first', $first);
$stmt->bindParam(':second', $second);
$stmt->execute();
#loop through your results here and then have a custom message,
#then change your variable values and execute the statement again.
#Repeat this until there are no more rows.
?>