Check if the tables_exists

This commit is contained in:
FusionPBX 2023-05-11 22:33:08 -06:00 committed by GitHub
parent 48fb933266
commit 4f60390b34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 20 additions and 14 deletions

View File

@ -289,6 +289,8 @@ if ($db_type == "odbc") {
$domain_array = explode(":", $_SERVER["HTTP_HOST"] ?? '');
//get the domains from the database
$database = new database;
if ($database->table_exists('v_domains')) {
$sql = "select * from v_domains";
$prep_statement = $db->prepare($sql);
$prep_statement->execute();
@ -297,6 +299,7 @@ if ($db_type == "odbc") {
$domain_names[] = $row['domain_name'];
}
unset($prep_statement);
}
//put the domains in natural order
if (is_array($domain_names)) {
@ -337,6 +340,8 @@ if ($db_type == "odbc") {
//get the software name
if (!isset($_SESSION["software_name"])) {
$database = new database;
if ($database->table_exists('v_software')) {
$sql = "select * from v_software ";
$prep_statement = $db->prepare(check_sql($sql));
if ($prep_statement) {
@ -346,6 +351,7 @@ if ($db_type == "odbc") {
}
unset($prep_statement, $result);
}
}
//set the setting arrays
if (!isset($_SESSION['domain']['menu'])) {