We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

How use SQL_CALC_FOUND_ROWS?

Hello how use SQL_CALC_FOUND_ROWS in phalcon?

result:

Column 'SQL_CALC_FOUND_ROWS' doesn't belong to any of the selected models (1), when preparing: SELECT SQL_CALC_FOUND_ROWS ROWCOUNT .....

What's a problem with count?

SQL_CALC_FOUND_ROWS is not standard SQL, thus Phalcon ORM doesn't recognize it. Either use COUNT(1), or execute it as raw SQL.

Sometimes we're deeply into some specific RDBMS flavour / SQL dialect... it shoudn't be like that!