db_query_range

  1. drupal
    1. 4.7 database.mysqli.inc
    2. 4.7 database.pgsql.inc
    3. 4.7 database.mysql.inc
    4. 5 database.mysqli.inc
    5. 5 database.pgsql.inc
    6. 5 database.mysql.inc
    7. 6 database.mysqli.inc
    8. 6 database.mysql.inc
    9. 6 database.pgsql.inc
    10. 7
Versions
4.7 – 6 db_query_range($query)
7 db_query_range($query, $from, $count, array $args = array(), array $options = array())

Executes a query against the active database, restricted to a range.

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

DatabaseStatementInterface A prepared statement object, already executed.

See also

DatabaseConnection::defaultOptions()

Related topics

▾ 44 functions call db_query_range()

aggregator_block_view in drupal/modules/aggregator/aggregator.module
Implements hook_block_view().
aggregator_feed_items_load in drupal/modules/aggregator/aggregator.pages.inc
Load feed items
aggregator_page_categories in drupal/modules/aggregator/aggregator.pages.inc
Menu callback; displays all the categories used by the aggregator.
aggregator_page_rss in drupal/modules/aggregator/aggregator.pages.inc
Menu callback; generate an RSS 0.92 feed of aggregator items or categories.
aggregator_page_sources in drupal/modules/aggregator/aggregator.pages.inc
Menu callback; displays all the feeds used by the aggregator.
BatchQueue::claimItem in drupal/includes/batch.queue.inc
block_add_block_form_validate in drupal/modules/block/block.admin.inc
Form validation handler for the add block form.
block_admin_configure_validate in drupal/modules/block/block.admin.inc
Form validation handler for the block configuration form.
block_theme_initialize in drupal/modules/block/block.module
Assign an initial, default set of blocks for a theme.
comment_update_7006 in drupal/modules/comment/comment.install
Migrate data from the comment field to field storage.
filter_format_exists in drupal/modules/filter/filter.module
Determines if a text format exists.
forum_node_presave in drupal/modules/forum/forum.module
Implements hook_node_presave().
forum_node_validate in drupal/modules/forum/forum.module
Implements hook_node_validate().
hook_update_index in drupal/modules/search/search.api.php
Update the search index for this module.
locale_date_format_save in drupal/includes/locale.inc
Save locale specific date formats to the database.
menu_edit_menu_name_exists in drupal/modules/menu/menu.admin.inc
Returns whether a menu name already exists.
menu_get_item in drupal/includes/menu.inc
Get a router item.
menu_node_prepare in drupal/modules/menu/menu.module
Implements hook_node_prepare().
node_admin_nodes in drupal/modules/node/node.admin.inc
Form builder: Builds the node administration overview.
node_assign_owner_action_validate in drupal/modules/node/node.module
Validates settings form for node_assign_owner_action().
node_type_save in drupal/modules/node/node.module
Saves a node type to the database.
node_update_index in drupal/modules/node/node.module
Implements hook_update_index().
path_admin_overview in drupal/modules/path/path.admin.inc
Return a listing of all defined URL aliases.
php_enable in drupal/modules/php/php.install
Implements hook_enable().
profile_autocomplete in drupal/modules/profile/profile.pages.inc
Callback to allow autocomplete of profile text fields.
profile_category_access in drupal/modules/profile/profile.module
Menu item access callback - check if a user has access to a profile category.
shortcut_set_title_exists in drupal/modules/shortcut/shortcut.module
Check to see if a shortcut set with the given title already exists.
simpletest_last_test_get in drupal/modules/simpletest/simpletest.module
Get information about the last test that ran given a test ID.
SystemQueue::claimItem in drupal/modules/system/system.queue.inc
system_date_format_save in drupal/modules/system/system.module
Saves a date format to the database.
system_update_7060 in drupal/modules/system/system.install
Create fields in preparation for migrating upload.module to file.module.
system_update_7061 in drupal/modules/system/system.install
Migrate upload.module data to the newly created file field.
taxonomy_update_7005 in drupal/modules/taxonomy/taxonomy.install
Migrate {taxonomy_term_node} table to field storage.
tracker_cron in drupal/modules/tracker/tracker.module
Implements hook_cron().
user_block_view in drupal/modules/user/user.module
Implements hook_block_view().
user_update_7000 in drupal/modules/user/user.install
Increase the length of the password field to accommodate better hashes.
user_update_7002 in drupal/modules/user/user.install
Convert user time zones from time zone offsets to time zone names.
user_update_7012 in drupal/modules/user/user.install
Add the user's pictures to the {file_managed} table and make them managed files.
user_update_7013 in drupal/modules/user/user.install
Add user module file usage entries.
_comment_update_node_statistics in drupal/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 drupal/modules/forum/forum.module
Updates the taxonomy index for a given node.
_node_access_rebuild_batch_operation in drupal/modules/node/node.module
Batch operation for node_access_rebuild_batch.
_tracker_calculate_changed in drupal/modules/tracker/tracker.module
Determine the max timestamp between $node->changed and the last comment.
_tracker_remove in drupal/modules/tracker/tracker.module
Clean up indexed data when nodes or comments are removed.

Code

drupal/includes/database/database.inc, line 2245

<?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);
}
?>