Subsequent fixes after major changes for PDO

This commit is contained in:
2023-02-24 12:16:25 +01:00
parent 7c300e0a8f
commit e74bde2d14
46 changed files with 289 additions and 321 deletions

View File

@@ -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);