Skip to content

Instantly share code, notes, and snippets.

@CrookedNumber
Created November 12, 2012 03:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CrookedNumber/4057335 to your computer and use it in GitHub Desktop.
Save CrookedNumber/4057335 to your computer and use it in GitHub Desktop.
Find actual drupal queries
// From http://www.opensourcery.com/blog/jessehs/what-was-query
// Devel Configuration -- Add this to
$conf['dev_query'] = TRUE;
<?php
global $queries;
$query = array_pop($queries);
dd($query, 'descriptive text about the query being printed out -- this one is logged to /tmp/drupal_debug.txt');
dpm($query, 'descriptive text about the query being printed out -- this one is printed to the screen');
?>
// Also: debug(strtr($query, $query->getArguments())); will show a query with arguments replaced in. It won't be quoted so it's not perfect but it integrates with the testing framework and doesn't require devel. (from CHX)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment