0

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?

1 Answer 1

1

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
Sign up to request clarification or add additional context in comments.

1 Comment

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... :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.