From 05a0bea5c599576ab04676778f270856173b9e84 Mon Sep 17 00:00:00 2001 From: laf Date: Thu, 26 Feb 2015 16:08:54 +0000 Subject: [PATCH] Fixed SQL queries that broke in MySQL 5.5 --- html/ajax_search.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/html/ajax_search.php b/html/ajax_search.php index 047137a61..d9d392550 100755 --- a/html/ajax_search.php +++ b/html/ajax_search.php @@ -75,7 +75,7 @@ if (isset($_REQUEST['search'])) } elseif($_REQUEST['type'] == 'ports') { // Search ports - $results = dbFetchRows("SELECT `ports`.* AS P,`devices`.* AS D FROM `ports` LEFT JOIN `devices` ON `ports`.`device_id` = `devices`.`device_id` WHERE `ifAlias` LIKE '%" . $search . "%' OR `ifDescr` LIKE '%" . $search . "%' ORDER BY ifDescr LIMIT 8"); + $results = dbFetchRows("SELECT `ports`.*,`devices`.* FROM `ports` LEFT JOIN `devices` ON `ports`.`device_id` = `devices`.`device_id` WHERE `ifAlias` LIKE '%" . $search . "%' OR `ifDescr` LIKE '%" . $search . "%' ORDER BY ifDescr LIMIT 8"); if (count($results)) { @@ -128,7 +128,7 @@ if (isset($_REQUEST['search'])) } elseif($_REQUEST['type'] == 'bgp') { // Search bgp peers - $results = dbFetchRows("SELECT `bgpPeers`.* AS B,`devices`.* AS D FROM `bgpPeers` LEFT JOIN `devices` ON `bgpPeers`.`device_id` = `devices`.`device_id` WHERE `astext` LIKE '%" . $search . "%' OR `bgpPeerIdentifier` LIKE '%" . $search . "%' OR `bgpPeerRemoteAs` LIKE '%" . $search . "%' ORDER BY `astext` LIMIT 8"); + $results = dbFetchRows("SELECT `bgpPeers`.*,`devices`.* FROM `bgpPeers` LEFT JOIN `devices` ON `bgpPeers`.`device_id` = `devices`.`device_id` WHERE `astext` LIKE '%" . $search . "%' OR `bgpPeerIdentifier` LIKE '%" . $search . "%' OR `bgpPeerRemoteAs` LIKE '%" . $search . "%' ORDER BY `astext` LIMIT 8"); if (count($results)) { $found = 1;