Jan
21
1 comment
Simplifying Queries: Using sum, count, etc in Propel 1.3
My old post handled Propel 1.2.
This is the way to do it in Propel 1.3
1 2 3 4 5 6 7 | $c = new Criteria(); $c->add(FavoriteDatePeer::EVENTDATAPROPOSAL_ID, $this->getId()); $c->addSelectColumn("SUM(".FavoriteDatePeer::SCORE.") as rank"); $stmt = FavoriteDatePeer::doSelectStmt($c); $row = $stmt->fetch(); return $row['rank']; |