#44319 [Opn]: Add access to actual query sent to DB

From: Date: Tue, 04 Mar 2008 11:28:03 +0000
Subject: #44319 [Opn]: Add access to actual query sent to DB
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-122909@lists.php.net to get a copy of this message
ID: 44319 Updated by: felipe@php.net Reported By: joe at digg dot com Status: Open -Bug Type: PDO related +Bug Type: Feature/Change Request Operating System: All PHP Version: 5.2.5 New Comment: Reclassified. Previous Comments: ------------------------------------------------------------------------ [2008-03-03 22:10:34] joe at digg dot com 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? ------------------------------------------------------------------------ [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

« previous php.bugs (#122909) next »