Simplify adding items to the domains array.

This commit is contained in:
markjcrane 2015-07-25 17:44:56 -06:00
parent 6548179a50
commit 68d2578eb8
1 changed files with 5 additions and 8 deletions

View File

@ -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") {
}
}
?>
?>