You are here

function db_fetch_array in Drupal 6

Same name in this branch
  1. 6 includes/database.mysqli.inc \db_fetch_array()
  2. 6 includes/database.mysql.inc \db_fetch_array()
  3. 6 includes/database.pgsql.inc \db_fetch_array()
Same name and namespace in other branches
  1. 4 includes/database.mysqli.inc \db_fetch_array()
  2. 4 includes/database.mysql.inc \db_fetch_array()
  3. 4 includes/database.pgsql.inc \db_fetch_array()
  4. 5 includes/database.mysqli.inc \db_fetch_array()
  5. 5 includes/database.mysql.inc \db_fetch_array()
  6. 5 includes/database.pgsql.inc \db_fetch_array()

Fetch one result row from the previous query as an array.

Parameters

$result: A database query result resource, as returned from db_query().

Return value

An associative array representing the next row of the result, or FALSE. The keys of this object are the names of the table fields selected by the query, and the values are the field values for this result row.

Related topics

56 calls to db_fetch_array()
aggregator_category_load in modules/aggregator/aggregator.module
Load an aggregator category.
aggregator_cron in modules/aggregator/aggregator.module
Implementation of hook_cron().
aggregator_feed_load in modules/aggregator/aggregator.module
Load an aggregator feed.
block_admin_configure in modules/block/block.admin.inc
Menu callback; displays the block configuration form.
block_box_get in modules/block/block.module
Returns information from database about a user-created (custom) block.

... See full list

File

includes/database.mysqli.inc, line 165
Database interface code for MySQL database servers using the mysqli client libraries. mysqli is included in PHP 5 by default and allows developers to use the advanced features of MySQL 4.1.x, 5.0.x and beyond.

Code

function db_fetch_array($result) {
  if ($result) {
    $array = mysqli_fetch_array($result, MYSQLI_ASSOC);
    return isset($array) ? $array : FALSE;
  }
}