$dst_host $dst_if)"); } else { echo(".."); } } else { } } } $sql = "SELECT * FROM `links` AS L, `interfaces` AS I, `devices` AS D WHERE L.src_if = I.interface_id AND I.device_id = D.device_id AND D.device_id = '".$device['device_id']."'"; $query = mysql_query($sql); while ($test_link = mysql_fetch_array($query)) { unset($exists); $i = 0; while ($i < count($link_exists) && !isset($exists)) { $this_link = $test_link['src_if'] . ",". $test_link['dst_if']; if ($link_exists[$i] == $this_link) { $exists = 1; } $i++; } if(!isset($exists)) { echo("-"); mysql_query("DELETE FROM `links` WHERE `src_if` = '".$test_link['src_if']."' AND `dst_if` = '".$test_link['dst_if']."'"); if($debug) { echo($link_exists[$i] . " REMOVED \n"); } } else { if($debug) { echo($link_exists[$i] . " VALID \n"); } } } echo("\n"); ?>