To limit number of rows returning for query I'm using:
$qb->setFirstResult($this->params->start);
$qb->setMaxResults($this->params->limit);
How to get number of rows if query will run without limit?
Typically, without doctrine I use SQL CURSOR to get total number of rows:
Begin transaction:
BEGIN;
Select 10 rows from 5:
DECLARE CURS1 CURSOR FOR
SELECT * FROM mytable;
MOVE FORWARD 5 IN CUSR1;
FETCH 10 FROM CURS1;
Calculate total rows via afftected rows of the next statement:
MOVE FORWARD ALL IN CURS1;
Commit transaction:
COMMIT;
--
You received this message because you are subscribed to the Google Groups
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.