db_column_exists($table, $column)
drupal/includes/database/database.inc, line 1922
Check if a column exists in the given table.
| Name | Description |
|---|---|
| Database abstraction layer | Allow the use of different database servers using the same code base. |
| Schema API | A Drupal schema definition is an array structure representing one or more tables and their related keys and indexes. A schema is defined by hook_schema(), which usually lives in a modulename.install file. |
function db_column_exists($table, $column) {
return Database::getActiveConnection()->schema()->columnExists($table, $column);
}