db_query_range

Versions
4.6 – 6
db_query_range($query)
7
db_query_range($query, $from, $count, array $args = array(), array $options = array())

Execute an arbitrary query string against the active database, restricted to a specified range.

See also

DatabaseConnection::defaultOptions()

Parameters

$query The prepared statement query to run. Although it will accept both named and unnamed placeholders, named placeholders are strongly preferred as they are more self-documenting.

$from The first record from the result set to return.

$count The number of records to return from the result set.

$args An array of values to substitute into the query. If the query uses named placeholders, this is an associative array in any order. If the query uses unnamed placeholders (?), this is an indexed array and the order must match the order of placeholders in the query string.

$options An array of options to control how the query operates.

Return value

A prepared statement object, already executed.

Related topics

▾ 44 functions call db_query_range()

aggregator_block_view in modules/aggregator/aggregator.module
Implement hook_block_view().
aggregator_feed_items_load in modules/aggregator/aggregator.pages.inc
Load feed items
aggregator_page_categories in modules/aggregator/aggregator.pages.inc
Menu callback; displays all the categories used by the aggregator.
aggregator_page_rss in modules/aggregator/aggregator.pages.inc
Menu callback; generate an RSS 0.92 feed of aggregator items or categories.
aggregator_page_sources in modules/aggregator/aggregator.pages.inc
Menu callback; displays all the feeds used by the aggregator.
batch_example_batch_1 in developer/examples/batch_example.module
Batch 1 : Load 100 times the node with the lowest nid
batch_example_op_2 in developer/examples/batch_example.module
Batch operation for batch 2 : load all nodes, 5 by five This is a multipart operation, using the
block_add_block_form_validate in modules/block/block.admin.inc
block_admin_configure_validate in modules/block/block.admin.inc
block_system_themes_form_submit in modules/block/block.module
Initialize blocks for enabled themes.
block_theme_initialize in modules/block/block.module
Assign an initial, default set of blocks for a theme.
comment_new_page_count in modules/comment/comment.module
Calculate page number for first new comment.
forum_node_presave in modules/forum/forum.module
Implement hook_node_presave().
forum_node_validate in modules/forum/forum.module
Implement hook_node_validate().
hook_file_references in modules/system/system.api.php
Report the number of times a file is referenced by a module.
hook_update_index in modules/search/search.api.php
Update Drupal's full-text index for this module.
locale_date_format_save in includes/locale.inc
Save locale specific date formats to the database.
menu_edit_menu_validate in modules/menu/menu.admin.inc
Validates the human and machine-readable names when adding or editing a menu.
menu_node_prepare in modules/menu/menu.module
Implement hook_node_prepare().
node_assign_owner_action_validate in modules/node/node.module
node_type_save in modules/node/node.module
Saves a node type to the database.
node_update_index in modules/node/node.module
Implement hook_update_index().
path_admin_overview in modules/path/path.admin.inc
Return a listing of all defined URL aliases.
php_install in modules/php/php.install
Implement hook_install().
profile_admin_settings_autocomplete in modules/profile/profile.admin.inc
Retrieve a pipe delimited string of autocomplete suggestions for profile categories
profile_autocomplete in modules/profile/profile.pages.inc
Callback to allow autocomplete of profile text fields.
profile_category_access in modules/profile/profile.module
Menu item access callback - check if a user has access to a profile category.
system_date_format_save in modules/system/system.module
Save a date format to the database.
taxonomy_update_7005 in modules/taxonomy/taxonomy.install
Migrate {taxonomy_term_node} table to field storage.
tracker_cron in modules/tracker/tracker.module
Implement hook_cron().
upload_file_references in modules/upload/upload.module
Implement hook_file_references().
upload_update_7000 in modules/upload/upload.install
Migrate upload module files from {files} to {file}.
user_account_form_validate in modules/user/user.module
Form validation handler for user_account_form().
user_autocomplete in modules/user/user.pages.inc
Menu callback; Retrieve a JSON object containing autocomplete suggestions for existing users.
user_block_view in modules/user/user.module
Implement hook_block_view().
user_file_references in modules/user/user.module
Implement hook_file_references().
user_update_7000 in modules/user/user.install
Increase the length of the password field to accommodate better hashes.
user_update_7002 in modules/user/user.install
Convert user time zones from time zone offsets to time zone names.
user_update_7004 in modules/user/user.install
Add the user's pictures to the {file} table and make them managed files.
_comment_update_node_statistics in modules/comment/comment.module
Updates the comment statistics for a given node. This should be called any time a comment is added, deleted, or updated.
_forum_update_forum_index in modules/forum/forum.module
Updates the taxonomy index for a given node.
_node_access_rebuild_batch_operation in modules/node/node.module
Batch operation for node_access_rebuild_batch.
_tracker_calculate_changed in modules/tracker/tracker.module
Determine the max timestamp between $node->changed and the last comment.
_tracker_remove in modules/tracker/tracker.module
Clean up indexed data when nodes or comments are removed.

Code

includes/database/database.inc, line 2038

<?php
function db_query_range($query, $from, $count, array $args = array(), array $options = array()) {
  if (empty($options['target'])) {
    $options['target'] = 'default';
  }

  return Database::getConnection($options['target'])->queryRange($query, $from, $count, $args, $options);
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.