SQL Statements simplified and some bugfixing
This commit is contained in:
@@ -85,18 +85,16 @@
|
||||
// setup subnets
|
||||
// build query
|
||||
$query = "SELECT
|
||||
subnet.subnet_id AS subnet_id,
|
||||
subnet.subnet_address AS subnet_address,
|
||||
subnet.subnet_mask AS subnet_mask
|
||||
s.subnet_id,
|
||||
s.subnet_address,
|
||||
s.subnet_mask
|
||||
FROM
|
||||
subnet,
|
||||
subnetlocation
|
||||
subnet AS s LEFT JOIN subnetlocation USING (subnet_id)
|
||||
WHERE
|
||||
subnetlocation.location_id=" . $location_id . "
|
||||
AND subnetlocation.subnet_id=subnet.subnet_id
|
||||
ORDER BY
|
||||
INET_ATON(subnet.subnet_address)";
|
||||
|
||||
INET_ATON(s.subnet_address)";
|
||||
|
||||
// run query
|
||||
$subnets = $db->db_select($query);
|
||||
$smarty->assign("subnets", $subnets);
|
||||
|
||||
Reference in New Issue
Block a user