ID: 44319 User updated by: joe at digg dot com Reported By: joe at digg dot com Status: Open Bug Type: PDO related Operating System: All PHP Version: 5.2.5 New Comment:
I just looked through the code. Looks like what I'm asking for is access to stmt->active_query_string which is in PDOStatement::execute()'s code. I'll poke around a bit more. I'd like access to it whether the statement executes successfully or not so it makes sense to expose it via a member variable. I can probably come up with a patch, but would want to do it in a way that'd actually get accepted. Thoughts? Previous Comments: ------------------------------------------------------------------------ [2008-03-03 21:46:26] joe at digg dot com Description: ------------ PEAR's DB (and others?) has a property called DB::$last_query that gives access to the *actual* query sent to the database. For the life of me I can't find this functionality in PDO and it's insanely useful for logging, debugging, etc. I doubt it'd be a big deal to add. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=44319&edit=1