Issues

ZF-2088: getLastQueryProfile doesn't show substituted values

Issue Type: New Feature Created: 2007-10-19T10:15:27.000+0000 Last Updated: 2013-02-10T16:15:15.000+0000 Status: Open Fix version(s): Reporter: Michael Long (phareous) Assignee: Ralph Schindler (ralph) Tags: - Zend_Db_Profiler

Related issues: Attachments:

Description

When called ->getLastQueryProfile() for an insert or update action in zend_db, the output doesn't show the substituted variables. This limits the usefulness.

For example:

<pre class="highlight">
       $data = array(
         'col1'        =>  'test',
         'col2'         =>  'test2',
         'col3'        =>  'test3',
     );
        $db->insert('test_table',$data);

$query=$profiler->getLastQueryProfile();
echo $query->getQuery();

Output is:

<pre class="highlight">
 INSERT INTO `test_table` (`col1`, `col2`, `col3`) VALUES (?, ?, ?)

Looking at this, there is no way to know what values were sent in the statement

Comments

Posted by Michael Long (phareous) on 2007-10-19T10:38:07.000+0000

It is possible to get the values by using ->getQueryParams()

It would be nice though to have a way of getting the merged SQL string.

Posted by Wil Sinclair (wil) on 2008-03-21T17:05:35.000+0000

This issue should have been fixed for the 1.5 release.

Posted by Wil Sinclair (wil) on 2008-03-25T20:43:58.000+0000

Please categorize/fix as needed.

Posted by Wil Sinclair (wil) on 2008-04-18T13:11:52.000+0000

This doesn't appear to have been fixed in 1.5.0. Please update if this is not correct.

Posted by Wil Sinclair (wil) on 2008-12-04T13:17:31.000+0000

Reassigning to Ralph since he's the new maintainer of Zend_Db

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts