PEAR::DB::showQuery request for feedback
| From: | negora | Date: | Mon, 01 Mar 2004 09:57:10 +0000 |
| Subject: | PEAR::DB::showQuery request for feedback | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-11027@lists.php.net to get a copy of this message | ||
Hi all,
*apparently my original post didn't make it on the list, if it did, i'm sorry for the dupe.
I'm just getting used to using PEAR::DB so my question may be (or sound) weird.
What I was looking for was a showQuery() method that would return the parsed(prepared, just before execution) query string, as it would be sent to the
database.
Not finding anything to resemble that, i edited my local copy of Pear/Db/common.php adding
function &showQuery($stmt, $data = array())
{
$realquery = $this->executeEmulateQuery($stmt, $data);
if (DB::isError($realquery)) {
return $realquery;
}
return $realquery;
}
which is basically a ripped off execute() and which simply returns the querystring. Now, I may be wrong, or going wrong about it, so please comment on
this. I find it extremely usefull for debugging purposes. Maybe it's just me.
Thanks and have a good one,
negora