R__
R__

Reputation: 1531

When using pdo's data binding,is there a way to get the actual sql executed by MySQL?

The SQL in program is like :

select * from table where column=?

But the actual sql should have no ?,I need this in a statistics functionality.

Anyone knows?

Upvotes: 0

Views: 29

Answers (1)

Kerrek SB
Kerrek SB

Reputation: 477368

I'm not really sure what you're asking, but there isn't any such thing like "acutal SQL". The PDO binding translates into an SQL prepared statement, which also looks like you code, directly in the database: PREPARE ... FROM SELECT * FROM table WHERE column = ?.

Binding the parameters to variables is done directly at the SQL level, and the database merely exposes an interface to that functionality via PDO.

Upvotes: 1

Related Questions