Search This Blog

Wednesday, January 4, 2012

Zend Framework db examine SQL query Or Print SQL query

$db->getProfiler()->setEnabled(true);
$db->update($data, array('id = ?' => $Posts->id));
print $db->getProfiler()->getLastQueryProfile()->getQuery();
print_r($db->getProfiler()->getLastQueryProfile()->getQueryParams());
$db->getProfiler()->setEnabled(false);

No comments: