I have tried using the following code to try and only enter a unique domain in the database.
$query = "INSERT IGNORE INTO domains2 (domain)
values ('$query2')";
print "running query: <br/>\n$query<br/>\n";
mysql_query($query, $link)
or die ("INSERT error:" .mysql_error());
For example if it tries to enter test.com/test.php and its already in the table it wont do it. However It still adds the data onto the table.
You have to have a
UNIQUEkey on thedomainfield for this to work.