OK so I am looking for a neat and short way to count the number of rows from a SELECT query using Doctrine DBAL.
I know that I could SELECT COUNT(*)
but then I need to sort through the array when I fetch results. Alternatively, it's been suggested to look in to getScalarResult()
. But I can't seem to find any documentation about this, other than in DQL (which is a different project).
So what is the neatest way to do this? I guess it's because I'm used to the great MySQLI attribute num_rows
!