1// You could have your values in variables (or hardcoded)
2$offset = 0;
3$limit = 5;
4
5$statement = $pdo->prepare('SELECT * FROM livro ORDER BY id OFFSET :offset ROWS FETCH NEXT :limit ROWS ONLY');
6
7// Next you need to bind the values
8$statement->bindValue(':offset', (int) $offset, PDO::PARAM_INT);
9$statement->bindValue(':limit', (int) $limit, PDO::PARAM_INT);
10
11// Now execute your statement
12$statement->execute();
13