Like I said in the topic,
My team developed social website based on Zend Framework (1.11).
The problem is that our client wants a debug (on screen list of DB queries) with
execution time, how many rows were affected and statement sentence.
Time and statement Zend_DB_profiler gets for us with no hassle, but
we need also the amount of rows that query affected (fetched, update, inserted or deleted).
Please help, how to cope with this task?
Add a comment
|
1 Answer
This is the current implementation which prevents you from getting what you want.
$qp->start($this->_queryId);
$retval = $this->_execute($params);
$prof->queryEnd($this->_queryId);
Possible solution would be:
- Create your own class for Statement, let's say extended from Zend_Db_Statement_Mysqli or what have you.
- Redefine its execute method so that $retval is carried on into $prof->queryEnd($this->_queryId);
- Redefine $_defaultStmtClass in Zend_Db_Adapter_Mysqli with your new statement class name
- Create your own Zend_Db_Profiler with public function queryEnd($queryId) redefined, so it accepts $retval and handles $retval
1 Comment
Marecky
thanks, that's exactly what I came with, Have to overload Zend_Db_Statement::execute called by Zend_Db_Statement_Pdo from Zend_Db_Adapter_Abstract... :)