2008年8月22日星期五

RE: [fw-db] DB Profiler

notmessenger wrote:
>
> $db->getProfiler()->setEnabled( true );
>
> // run your query in between the code calls above and below
>
> $profiler = $db->getProfiler();
> $lastQuery = $profiler->getLastQueryProfile();
> echo $lastQuery->getQuery();
>

$db = $this->getAdapter();
$db->getProfiler()->setEnabled( true );
// run your query in between the code calls above and below

$sqlxx = <<<EOT
SELECT
FORMAT(NULL,2) as secs
FROM page
LIMIT ?, ?
EOT;

$all = $db->fetchAll( $sqlxx, array( $page*$per, $per ) );
$profiler = $db->getProfiler();
$lastQuery = $profiler->getLastQueryProfile();
$q = $lastQuery->getQuery();

return $all;

$q ==

SELECT
FORMAT(NULL,2) as secs
FROM page
LIMIT ?, ?

Boo :-( (actually I'd got this far myself -- it's quite easy to follow the
code using a debugger)

Anyone??

monk.e.boy
--
View this message in context: http://www.nabble.com/DB-Profiler-tp19104036p19108527.html
Sent from the Zend DB mailing list archive at Nabble.com.

没有评论: