db_column_exists

  1. drupal
    1. drupal6
    2. drupal6 database.mysqli.inc
    3. drupal6 database.pgsql.inc
    4. drupal7 database.inc
Versionen
drupal6 – drupal7 db_column_exists($table, $column)

Check if a column exists in the given table.

Übergabeparameter

$table The name of the table.

$column The name of the column.

Rückgabewert

TRUE if the column exists, and FALSE if the column does not exist.

Verwandte Themen

Code

includes/database.mysql.inc, line 371

<?php
function db_column_exists($table, $column) {
  return (bool) db_fetch_object(db_query("SHOW COLUMNS FROM {" . db_escape_table($table) . "} LIKE '" . db_escape_table($column) . "'"));
}
?>

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