1 database.inc public DatabaseStatementEmpty::fetchAllKeyed($key_index = 0, $value_index = 1)

Returns the entire result set as a single associative array.

This method is only useful for two-column result sets. It will return an associative array where the key is one column from the result set and the value is another field. In most cases, the default of the first two columns is appropriate.

Note that this method will run the result set to the end.

Parameters

int $key_index: The numeric index of the field to use as the array key.

int $value_index: The numeric index of the field to use as the array value.

Return value

array: An associative array, or an empty array if there is no result set.

Overrides DatabaseStatementInterface::fetchAllKeyed

File

core/includes/database/database.inc, line 2535
Core systems for the database layer.

Class

DatabaseStatementEmpty
Empty implementation of a database statement.

Code

public function fetchAllKeyed($key_index = 0, $value_index = 1) {
  return array();
}