$sth->{Statement} returns the prepared statement. Using this as a base You can get the used values in a HashRef by $boundParams = $sth->{ParamValues} after an execute. I did not used it before ... but it should work.
Regards Robert aspiritus schrieb:
Hello all experts ! I need to log every INSERT, UPDATE and DELETE queries even when using placeholders. Here some code: $sql = "UPDATE users SET `name`=? WHERE ìd`=1;"; $sth = $dbh->prepare($sql); $sth->execute('Test User'); $sth->finish(); Of course execute params are given dynamically and I want to use placeholders for more secure code. I want to save that UPDATE query into file or database ( I'll prefer DB :) ) for tracking purposes. Any idea how to do this?