Last active
December 12, 2016 22:34
-
-
Save bdlangton/f2ad5b4c06755a7f025ebfafdb6d0cae to your computer and use it in GitHub Desktop.
Print out db_select/views final query for debugging
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Print out query built by views: | |
// Can use pre_execute or post_render (probably more also). | |
function hook_views_pre_execute(&$view) { | |
dpq($view->build_info['query']); | |
} | |
// Print out query build by db_select: | |
dpm((string) $query); | |
dpm($query->arguments()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment