public function executeShow()
 {
     $this->question = QuestionPeer::retrieveByPk($this->getRequestParameter('id'));
     $c = new Criteria();
     $c->add(SolutionPeer::QUESTION_ID, $this->question->getId());
     $c->addDescendingOrderByColumn(SolutionPeer::CREATED_AT);
     $this->solutions = SolutionPeer::doSelect($c);
     $this->forward404Unless($this->question);
 }
<?php

$qid = $question->getId();
$c = new Criteria();
$c->add(SolutionPeer::QUESTION_ID, $qid);
echo $data = SolutionPeer::doCount($c);