drupal_schema_fields_sql

  1. drupal
    1. drupal6
    2. drupal7
Versionen
drupal6 – drupal7 drupal_schema_fields_sql($table, $prefix = NULL)

Retrieve a list of fields from a table schema. The list is suitable for use in a SQL query.

Übergabeparameter

$table The name of the table from which to retrieve fields.

An optional prefix to to all fields.

Rückgabewert

An array of fields.

Verwandte Themen

▾ 2 functions call drupal_schema_fields_sql()

node_load_multiple in modules/node/node.module
Load node objects from the database.
taxonomy_term_load_multiple in modules/taxonomy/taxonomy.module
Load multiple taxonomy terms based on certain conditions.

Code

includes/common.inc, line 4150

<?php
function drupal_schema_fields_sql($table, $prefix = NULL) {
  $schema = drupal_get_schema($table);
  $fields = array_keys($schema['fields']);
  if ($prefix) {
    $columns = array();
    foreach ($fields as $field) {
      $columns[] = "$prefix.$field";
    }
    return $columns;
  }
  else {
    return $fields;
  }
}
?>

Kommentare

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen