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

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


$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


Related topics

▾ 54 functions call db_query_range()

AggregatorTestCase::getDefaultFeedItemCount in modules/aggregator/aggregator.test
Return the count of the randomly created feed array.
aggregator_block_view in modules/aggregator/aggregator.module
Implements 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.
BatchQueue::claimItem in includes/batch.queue.inc
block_add_block_form_validate in modules/block/block.admin.inc
Form validation handler for the add block form.
block_admin_configure_validate in modules/block/block.admin.inc
Form validation handler for the block configuration form.
block_theme_initialize in modules/block/block.module
Assign an initial, default set of blocks for a theme.
CommentActionsTestCase::assertWatchdogMessage in modules/comment/comment.test
Verify that a watchdog message has been entered.
comment_update_7006 in modules/comment/comment.install
Migrate data from the comment field to field storage.
DatabaseRangeQueryTestCase::testRangeQuery in modules/simpletest/tests/database_test.test
Confirm that range query work and return correct result.
FilterExampleTestCase::setUp in examples/filter_example/filter_example.test
Enable modules and create user with specific permissions.
filter_format_exists in modules/filter/filter.module
Determines if a text format exists.
ForumTestCase::doAdminTests in modules/forum/forum.test
Run admin tests on the admin user.
forum_node_presave in modules/forum/forum.module
Implements hook_node_presave().
forum_node_validate in modules/forum/forum.module
Implements hook_node_validate().
hook_update_index in modules/search/search.api.php
Update the search index for this module.
locale_date_format_save in includes/locale.inc
Save locale specific date formats to the database.
MenuBreadcrumbTestCase::testBreadCrumbs in modules/simpletest/tests/menu.test
Tests breadcrumbs on node and administrative paths.
menu_edit_menu_name_exists in modules/menu/menu.admin.inc
Returns whether a menu name already exists.
menu_get_item in includes/menu.inc
Get a router item.
menu_node_prepare in modules/menu/menu.module
Implements hook_node_prepare().
NewDefaultThemeBlocks::testNewDefaultThemeBlocks in modules/block/block.test
Check the enabled Bartik blocks are correctly copied over.
NodeBodyUpgradePathTestCase::testNodeBodyUpgrade in modules/simpletest/tests/upgrade/upgrade.node.test
Test a successful upgrade.
node_admin_nodes in modules/node/node.admin.inc
Form builder: Builds the node administration overview.
node_assign_owner_action_validate in modules/node/node.module
Validates settings form for node_assign_owner_action().
node_type_save in modules/node/node.module
Saves a node type to the database.
node_update_index in modules/node/node.module
Implements hook_update_index().
path_admin_overview in modules/path/path.admin.inc
Return a listing of all defined URL aliases.
php_enable in modules/php/php.install
Implements hook_enable().
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.
shortcut_set_title_exists in modules/shortcut/shortcut.module
Check to see if a shortcut set with the given title already exists.
simpletest_last_test_get in modules/simpletest/simpletest.module
Get information about the last test that ran given a test ID.
SystemQueue::claimItem in modules/system/system.queue.inc
system_date_format_save in modules/system/system.module
Saves a date format to the database.
system_update_7060 in modules/system/system.install
Create fields in preparation for migrating upload.module to file.module.
system_update_7061 in modules/system/system.install
Migrate upload.module data to the newly created file field.
TaxonomyWebTestCase::createTerm in modules/taxonomy/taxonomy.test
Returns a new term with random properties in vocabulary $vid.
taxonomy_update_7005 in modules/taxonomy/taxonomy.install
Migrate {taxonomy_term_node} table to field storage.
tracker_cron in modules/tracker/tracker.module
Implements hook_cron().
user_block_view in modules/user/user.module
Implements hook_block_view().
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_7012 in modules/user/user.install
Add the user's pictures to the {file_managed} table and make them managed files.
user_update_7013 in modules/user/user.install
Add user module file usage entries.
_aggregator_has_categories in modules/aggregator/aggregator.module
Find out whether there are any aggregator categories.
_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.


includes/database/database.inc, line 2343

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