function db_queryd_range in Devel 6
Debugging version of db_query_range().
Echoes the query to the browser.
File
- ./
devel.module, line 2008
Code
function db_queryd_range($query) {
$args = func_get_args();
$count = array_pop($args);
$from = array_pop($args);
array_shift($args);
$query = db_prefix_tables($query);
if (isset($args[0]) and is_array($args[0])) {
// 'All arguments in one array' syntax
$args = $args[0];
}
_db_query_callback($args, TRUE);
$query = preg_replace_callback(DB_QUERY_REGEXP, '_db_query_callback', $query);
if ($GLOBALS['db_type'] == 'pgsql') {
$query .= ' LIMIT ' . (int) $count . ' OFFSET ' . (int) $from;
}
else {
$query .= ' LIMIT ' . (int) $from . ', ' . (int) $count;
}
return _db_query($query, 1);
}