Search code examples
symfony1criteriapropel

How to do a "Select count..." with symfony and propel?


I'm trying to do a very simple sql query like this, to a propel Criteria :

SELECT count(id_user) FROM myTable WHERE id_page = 5

I did'nt found informations on the documentation.

Have you an idea ??


Solution

  • $c = new Criteria();
    $c->add(myTablePeer::ID_PAGE,5);
    $count = myTablePeer::doCount($c);