开发者

Propel: newbie problems with a criteria. Trying to debug

I have this criteria propel.

public static function ge开发者_JAVA技巧tPrenotazioniAttive($id_utente)
{

$c = new Criteria();
$c->add(self::USER_ID, 18793 );
$result = self::doSelect($c);

}

After that i add this:

echo $c->toString();

that shows:

 Criteria: SQL (may not be complete): SELECT FROM `prenotazione` WHERE prenotazione.USER_ID=:p1 Params: prenotazione.USER_ID => 18793

Then i call the method before this way:

    $prenotazioni = PrenotazionePeer::getPrenotazioniAttive($this->getUser());  

    var_dump($prenotazioni);
    die("entro");

that creates/execute the SQL clause below.

 SELECT IFNULL(SUM(prenotazione.VALUTAZIONE),0) AS somma, 
 COUNT(*) AS numero 
 FROM `prenotazione` 
 WHERE prenotazione.USER_ID=18793

that clause (if i go to phpmyadmin) retrives a row from the table.

My problem: var_dump($prenotazioni); just return null, any idea?


The getPrenotazioniAttive function you posted has no return clause. It should end with return $result; if you want to get the data outside the function.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜