Re: PEAR::DB::showQuery request for feedback

From: Date: Tue, 09 Mar 2004 17:24:51 +0000
Subject: Re: PEAR::DB::showQuery request for feedback
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-11183@lists.php.net to get a copy of this message
I also think that this is useful. Negora wrote:
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
-- paperCrane <Justin Patrin>

« previous php.pear.general (#11183) next »