well i do not know how to use sql union properly . i have two tables with domains(url) i want to compare table1 with table2 so that i get unique domain from table 2 which is not in table 1.
example
table1
id domain
1 google.com
2 facebook
3 stackoverflow.com
table2
id domain
1 youtube.com
2 facebook
3 stackoverflow.com
so i want that i compare both tables and get youtube.com because its not in table1 i used sql union like that
$query="SELECT table1.domain, table2.domain "."FROM table1, table2 "."WHERE table1.domain != table2.domain";
$result = mysql_query($query) or die(mysql_error());
while ($rec = mysql_fetch_array($result))
{
$new_url=$rec["domain"];
}
now i get double results like youtube.com youtube.com so help whats wrong with my sql statement