Try something more like this.
<?php
$link = array_unique($link); ## -- Remove duplicates in array
$sql = ("SELECT `url` FROM `list`"); # -- Select all links in the list table
$rs = mysql_query($sql);
while($row = mysql_fetch_array($rs)) {
$url = $row["url"];
foreach ($link as $key => $curr_link) { # - Loop through all links in array
$curr_link = trim($curr_link);
if($url == $curr_link){ # - A match!
$link[$key] = ""; # - If match, make $link blank
}
$x++;
}
}
?>
First thing I noticed is that you're calling mysql_fetch_array twice, so you're always gonna skip over the first result returned by the DB. I didn't actually test this code, just kind of eyeballed it so it may be off