views:

101

answers:

1

Is there any way to get the actual SQL that is the result of preparing a statement when using the mysqli extension?

My problem: I am using prepared statements. In all cases, they SHOULD update a record. I am not catching any errors. However, when I check for affected rows, there are none. So, I want to see the actual SQL that would be executed as a result of the prepare statement.

Is there any way to do this? I've check the mysqli reference docs, but they don't seem to have anything.

A: 

Look at this question for answers to you question.

Davide Gualano
Funny, just did that myself. I don't know how you managed to know that answer was around though. Of course, this only works if you have control of the DB server.... If you don't it seems you're out of luck.
Justin
I was browsing through questions tagged 'mysqli', and I stumbled in that question and immediately after in your own :)And yes, you have to turn logging on the mysql server to achieve what you need.
Davide Gualano