LMSouq
database Open

Doctrine - How to print out the real sql, not just the prepared statement?

AM
Amandasaurus
1 month ago
3 views
Problem Description
We're using Doctrine, a PHP ORM. I am creating a query like this: $q = Doctrine_Query::create()->select('id')->from('MyTable'); and then in the function I'm adding in various where clauses and things as appropriate, like this $q->where('normalisedname = ? OR name = ?', array($string, $originalString)); Later on, before ``execute()``-ing that query object, I want to print out the raw SQL in order to examine it, and do this: $q->getSQLQuery(); However that only prints out the prepared statement, not the full query. I want to see what it is sending to the MySQL, but instead it is printing out a prepared statement, including ``?``'s. Is there some way to see the 'full' query?

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base