Error message

You are browsing documentation for drupal 7.x, which is not supported anymore. Read the updated version of this page for drupal 11.x (the latest version).

function DatabaseStatementPrefetch::fetchColumn

1 call to DatabaseStatementPrefetch::fetchColumn()
DatabaseStatementPrefetch::fetchField in includes/database/prefetch.inc
Returns a single field from the next record of a result set.

File

includes/database/prefetch.inc, line 387

Class

DatabaseStatementPrefetch
An implementation of DatabaseStatementInterface that prefetches all data.

Code

public function fetchColumn($index = 0) {
 if (isset($this->currentRow ) && isset($this->columnNames [$index])) {
 // We grab the value directly from $this->data, and format it.
 $return = $this->currentRow [$this->columnNames [$index]];
 $this->next ();
 return $return;
 }
 else {
 return FALSE;
 }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.