| Versionen | |
|---|---|
| drupal6 – drupal7 | db_column_exists($table, $column) |
Check if a column exists in the given table.
$table The name of the table.
$column The name of the column.
TRUE if the column exists, and FALSE if the column does not exist.
includes/
<?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