Subsequent fixes after major changes for PDO
This commit is contained in:
9
node.php
9
node.php
@@ -24,10 +24,9 @@ if(isset($_GET['subnet_id'])) {
|
||||
$sql = "SELECT CONCAT_WS('/',subnet_address,subnet_mask) AS subnet
|
||||
FROM subnet
|
||||
WHERE subnet_id=?";
|
||||
$sth = $dbh->prepare($sql);
|
||||
$sth->execute([$subnet_id]);
|
||||
$sth = $dbh->prepare($sql);
|
||||
$sth->execute([$subnet_id]);
|
||||
$smarty->assign("subnet", $sth->fetchColumn());
|
||||
|
||||
} else {
|
||||
$smarty->assign("subnet_id", '');
|
||||
}
|
||||
@@ -38,9 +37,9 @@ $where = join(' AND ', $w);
|
||||
$sql = "SELECT a.asset_id, a.asset_info,
|
||||
REPLACE(a.asset_name, ' ', ' ') AS asset_name,
|
||||
n.node_id, n.node_ip
|
||||
FROM asset AS a LEFT JOIN node AS n USING (asset_id)";
|
||||
FROM node AS n LEFT JOIN asset AS a USING (asset_id)";
|
||||
if ($where) {
|
||||
$sql .= ' WHERE ' . $where;
|
||||
$sql .= ' WHERE ' . $where;
|
||||
}
|
||||
$sql .= "GROUP BY n.node_id ORDER BY INET_ATON(n.node_ip)";
|
||||
$sth = $dbh->prepare($sql);
|
||||
|
||||
Reference in New Issue
Block a user