Reputation: 8700
$PDO = Doctrine_Manager::getInstance()->connection()->getDbh();
$PDO->prepare("
//SQL Query Here
")->execute();
I was told 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?
Upvotes: 1
Views: 433
Reputation: 36191
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
Upvotes: 1