Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- public function countAllOrderedByCreatedAt($firstResult)
- {
- $conn = $this->getEntityManager()->getConnection();
- $sql = 'SELECT count(*) FROM (SELECT * FROM post LIMIT 5 OFFSET :firstResult) as pg';
- $statement = $conn->prepare($sql);
- $statement->execute(['firstResult' => 20]);
- return $statement->fetch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement