function _signup_db_column_exists in Signup 5.2
1 call to _signup_db_column_exists()
- signup_update_5201 in ./
signup.install - Add the close_signup_limit field to the {signup} table to allow signup limits for sites that upgraded from 4.6.x. The original signup.install for 4.7.x accidentally included this column in the DB, but it's never been used in the code until now. …
File
- ./
signup.install, line 362
Code
function _signup_db_column_exists($table, $column) {
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
return db_num_rows(db_query("SHOW COLUMNS FROM {%s} LIKE '%s'", $table, $column));
case 'pgsql':
return db_result(db_query("SELECT COUNT(pg_attribute.attname) FROM pg_class, pg_attribute WHERE pg_attribute.attrelid = pg_class.oid AND pg_class.relname = '{%s}' AND attname='%s'", $table, $column));
}
}