$q = Doctrine_Manager::getInstance()->getCurrentConnection(); $res = $q->execute("SELECT SUM(ptp) as total FROM table WHERE id = $id"); $total = $res->fetchColumn();