Reputation: 1837
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 ??
Upvotes: 3
Views: 5480
Reputation: 385
If you want to issue a SELECT COUNT(*) based on your current ModelCriteria you can also perform
$yourCriteria->count();
This will return you the number of results.
Upvotes: 2
Reputation: 92772
$c = new Criteria();
$c->add(myTablePeer::ID_PAGE,5);
$count = myTablePeer::doCount($c);
Upvotes: 4