We\'re using Doctrine, a PHP ORM. I am creating a query like this:
$q = Doctrine_Query::create()->select(\'id\')->from(\'MyTable\');
There is no other real query, this is how prepared statements work. The values are bound in the database server, not in the application layer.
See my answer to this question: In PHP with PDO, how to check the final SQL parametrized query?
(Repeated here for convenience:)
Using prepared statements with parametrised values is not simply another way to dynamically create a string of SQL. You create a prepared statement at the database, and then send the parameter values alone.
So what is probably sent to the database will be a
PREPARE ...
, thenSET ...
and finallyEXECUTE ....
You won't be able to get some SQL string like
SELECT * FROM ...
, even if it would produce equivalent results, because no such query was ever actually sent to the database.