getComment

  1. drupal
    1. drupal7
Versionen
drupal7 public DatabaseSchema_mysql::getComment($table, $column = NULL)

Retrieve a table or column comment.

Verwandte Themen

Code

includes/database/mysql/schema.inc, line 370

<?php
public function getComment($table, $column = NULL) {
  $condition = $this->buildTableNameCondition($this->connection->prefixTables('{' . $table . '}'));
  if (isset($column)) {
    $condition->condition('column_name', $column);
    $condition->compile($this->connection);
    // Don't use {} around information_schema table.
    return db_query("SELECT column_comment FROM information_schema.columns WHERE " . (string) $condition, $condition->arguments())->fetchField();
  }
  $condition->compile($this->connection);
  // Don't use {} around information_schema table.
  $comment = db_query("SELECT table_comment FROM information_schema.tables WHERE " . (string) $condition, $condition->arguments())->fetchField();
  // Work-around for MySQL 5.0 bug http://bugs.mysql.com/bug.php?id=11379
  return preg_replace('/; InnoDB free:.*$/', '', $comment);
}
?>

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