domain_prefix_table_exists($prefix, $table)
domain_prefix/domain_prefix.module, line 455
Does a table exist -- we use this to bypass Drupal's default table prefixing check.
$prefix The table prefix used with this domain. Optional.
$table The name of the table being acted upon.
function domain_prefix_table_exists($prefix, $table) {
global $db_type;
$string = db_escape_table($prefix . $table);
switch ($db_type) {
case 'pgsql':
$query = "SELECT table_name FROM information_schema.tables WHERE table_schema = 'public' AND table_name = '{%s}'";
break;
default:
$query = "SHOW TABLES LIKE '{%s}'";
break;
}
return db_num_rows(db_query($query, $string));
}