diff --git a/resources/pdo.php b/resources/pdo.php index c9ba60fa0b..0c63ca94d3 100644 --- a/resources/pdo.php +++ b/resources/pdo.php @@ -241,12 +241,11 @@ if ($db_type == "pgsql") { $prep_statement = $db->prepare($sql); $prep_statement->execute(); $result = $prep_statement->fetchAll(PDO::FETCH_NAMED); - if (count($result) > 0) { - foreach($result as $row) { - $domain_names[] = $row['domain_name']; - } + foreach($result as $row) { + $domain_names[] = $row['domain_name']; } unset($prep_statement); + //put the domains in natural order natsort($domain_names); //build the domains array in the correct order @@ -270,9 +269,7 @@ if ($db_type == "pgsql") { $_SESSION["domain_name"] = $row["domain_name"]; } } - $_SESSION['domains'][$row['domain_uuid']]['domain_uuid'] = $row['domain_uuid']; - $_SESSION['domains'][$row['domain_uuid']]['domain_name'] = $row['domain_name']; - $_SESSION['domains'][$row['domain_uuid']]['domain_description'] = $row['domain_description']; + $_SESSION['domains'][$row['domain_uuid']] = $row; } unset($domains, $prep_statement); } @@ -336,4 +333,4 @@ if ($db_type == "pgsql") { } } -?> \ No newline at end of file +?>