OK, so I'm looking for a neat and short way to count the number of rows from a SELECT query using Doctrine DBAL.
I know I can SELECT COUNT(*) , but then I need to sort the array when I get the results. As an alternative, it was suggested to take a look at getScalarResult() . But I can not find any documentation about this, except in DQL (this is a different project).
So what is the easiest way to do this? I guess, because I'm used to the excellent MySQLI attribute num_rows !
php doctrine2
penguin
source share