Symfony Doctrine query returning not working, returning 1 and 11
$PDO = Doctrine_Manager::getInstance()->connection()->getDbh();
$PDO->prepare("
//SQL Query Here
")->execute();
I was to开发者_开发问答ld that this will work for creating a custom Doctrine query in Symfony. Regardless of what I put inside the prepare statement I get a value of 1 returned. Print_r of the returned variable gives 11. How odd... what is going on?
That's because execute() returns TRUE on success and FALSE on FAILURE: http://pl.php.net/manual/en/pdostatement.execute.php
You should use one of the fetch* methods to actually retrieve data: http://pl.php.net/manual/en/pdostatement.fetchall.php
精彩评论