Query both tables and put the results of each into their own respective arrays. Then use the example I have given here below to come up with your output. This example assumes you have already output your two queries into their own arrays. (Don't worry, this code will shrink up when you get rid of all of the superfluous stuff. I left it all in there, so you can see exactly what the process entails.
The example I have given you will find values that don't appear in both tables and output that into an array sorted alphabetically by name. In this case, the final output array would be:
Array ( [0] => Dave [1] => Joe [2] => Rick [3] => Sam )
<?php
// Here are the two arrays you created from your queries
$array1 = array("Joe", "Mike", "John", "Dave");
$array2 = array("Sam", "John", "Mike", "Rick");
// Output each one, so you can verify the results. You can comment these lines when you are sure you got what you want (except where annotated).
echo "<b>Array 1:</b> ";
print_r($array1);
echo "<br />";
echo "<b>Array 2:</b> ";
print_r($array2);
echo "<br /><br />";
$merge_result = array_merge($array1, $array2); // Keep this line
echo "<b>Merged Results:</b> ";
$merge_result = array_unique($merge_result); // Keep this line
print_r($merge_result);
echo "<br /><br />";
// Find the difference between the merged arrays and array 1. Then do the same for array 2.
$merge_result1 = array_diff($merge_result, $array1); // Keep this line
echo "<b>Merged Results/Array 1 Difference:</b> ";
print_r($merge_result1);
echo "<br />";
$merge_result2 = array_diff($merge_result, $array2); // Keep this line
echo "<b>Merged Results/Array 2 Difference:</b> ";
print_r($merge_result2);
echo "<br /><br />";
// Now we take our two difference arrays and merge them into one array so we can then do whatever we want from there.
$final_result = array_merge($merge_result1,$merge_result2); //Keep this line
sort($final_result); //Keep this line
echo "<b>Final merged results (sorted):</b> ";
print_r($final_result);
?>