When you are executing a DQL there must be situation where you might need to see the parameters and its values for the underlying SQL. Usually Doctrine queries are prepared statements and you will not be able to see the values which pass through the query. Prepared statement works in the following way,
- Sending the statement,
- Sending the parameters,
- And executing the prepared statement.
(More information on prepared statements :- http://www.w3schools.com/pHp/php_mysql_prepared_statements.asp)
So, what you see when you get the SQL query is something similar to this,
SELECT * FROM some_table WHERE column1 = ? AND column2 = ?
So today, I am going to show you a workaround to get the parameters (such as column1, column2 and so on…) and most importantly get the respective values for those parameters. Continue reading