Drupal 7 Query Debug
In drupal 7 if you want to debug a query you can use devel module with :
dpq
Or use this function :
function _get_query_string(SelectQueryInterface $query) {
$string = (string) $query;
$arguments = $query->arguments();
if (!empty($arguments) && is_array($arguments)) {
foreach ($arguments as $placeholder => &$value) {
if (is_string($value)) {
$value = "'$value'";
}
}
$string = strtr($string, $arguments);
}
return $string;
}
Written by Clement Hurel
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Drupal7
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#