Skip to content

Instantly share code, notes, and snippets.

@chriscalip
Created July 29, 2015 01:03
Show Gist options
  • Save chriscalip/01bf36150420dfd356d6 to your computer and use it in GitHub Desktop.
Save chriscalip/01bf36150420dfd356d6 to your computer and use it in GitHub Desktop.
<?php
if (!function_exists('krumo')) {
has_krumo();
}
$nids = db_query('SELECT nid FROM {node} n')->fetchCol();
$query = db_select('node', 'n');
$query->addTag('ranmgkmg');
$query->fields('n', array('nid'));
$query->condition('nid', array(1,2,3,4,5), 'IN');
$results = $query->execute()->fetchCol();
$query_string = (string) $query;
$better_query_string = strtr((string) $query, $query->arguments());
krumo(array(
$nids,
$results,
$query_string,
$better_query_string
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment