openfrog
openfrog

Reputation: 40755

How can I see the SQL statements which go to the database when using PDO?

How can I see the SQL statements which go to the database when using PDO?

Upvotes: 0

Views: 89

Answers (2)

keimol
keimol

Reputation: 26

If you are using MySQL, enable the query log?

Upvotes: 1

Ivan Krechetov
Ivan Krechetov

Reputation: 19220

I don't know how to do this with bare PDO, but if you wrap PDO in a Zend_Db_Adapter, then you can use Zend_Db_Profiler.

Then you'll be able to see the parameterized queries, together with the parameter values. Also, its profiling, i.e. measuring the query execution times.

Upvotes: 1

Related Questions