diff --git a/html/includes/print-map.inc.php b/html/includes/print-map.inc.php
index c9fc541d1..6fc83465b 100644
--- a/html/includes/print-map.inc.php
+++ b/html/includes/print-map.inc.php
@@ -17,12 +17,12 @@ $row_colour="#ffffff";
$sql_array= array();
if (!empty($device['hostname'])) {
- $sql = ' WHERE `devices`.`hostname`=?';
+ $sql = ' `devices`.`hostname`=?';
$sql_array = array($device['hostname']);
$mac_sql = ' AND `D`.`hostname` = ?';
$mac_array = array($device['hostname']);
} else {
- $sql = ' WHERE 1';
+ $sql = ' ';
}
$sql .= ' AND `local_device_id` != 0 AND `remote_device_id` != 0 ';