domain_get_primary_table($table)Escape the names of the default tables for variable lookups.
There are a few cases where we must directly query data from the primary site's database. Due to table prefixing and Domain Prefix, we must ensure that we are querying the correct table.
When using this function, you should insert the $table result directly into your query string, or use token replacement '%s' syntax. Do not enclose the table name in brackets {}, as that defeats the purpose of this function.
$table The name of the base table to lookup.
A query-safe table name pointing to the primary domain.
./domain.bootstrap.inc, line 231
<?php
function domain_get_primary_table($table) {
global $db_prefix;
if (is_string($db_prefix)) {
$table = $db_prefix . $table;
}
else if (is_array($db_prefix)) {
$table = $db_prefix['default'] . $table;
}
return db_escape_table($table);
}
?>