Show raw sql query for a view

Public

</> CopyGet raw version
php
  1. function MY_MODULE_views_pre_execute(&$view) {
  2. dpq($view->build_info['query']);
  3. }

Comments

sanglt's picture

The $view is a object and since Drupal 5.3 you no need to use &$view. Just use function MY_MODULE_views_pre_execute($view) {