function drush_db_result

8.0.x dbtng.inc drush_db_result($result)
6.x dbtng.inc drush_db_result($result)
7.x dbtng.inc drush_db_result($result)
3.x drush.inc drush_db_result($result)
4.x drush.inc drush_db_result($result)
5.x dbtng.inc drush_db_result($result)
master dbtng.inc drush_db_result($result)

A db_result() that works consistently for any version of Drupal.

Parameters

A Database result object.:

Related topics

3 calls to drush_db_result()
drush_module_list in commands/core/drupal/environment_7.inc
Returns a list of enabled modules.
drush_variable_delete in commands/core/variable.drush.inc
Command callback. Delete a variable.
drush_variable_set in commands/core/variable.drush.inc
Command callback. Set a variable.

File

includes/dbtng.inc, line 172
Wrappers to abstract database operations from Drupal version.

Code

function drush_db_result($result) {
  switch (drush_drupal_major_version()) {
    case 6:
      return db_result($result);
    case 7:
    default:
      return $result->fetchField();
  }
}