Q:

two php querys, show all results from table 1 and mark were id and user is the same in table 2

i have two table, the first is uploaded briefings. 
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+  ID +  Title  +  Owner + Grade    + Location                       +    Expiry  +
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+  1  +  Test1  +  123   +  1a      +  Office 1, Office 2, Office 3  + 1404169200 +
+  2  +  Test2  +  123   +  1n      +  Office 1                      + 1404169200 +
+  3  +  Test3  +  126   +  1a      +  Office 1                      + 1404169200 +
+  4  +  Test4  +  126   +  1n,1a   +  Office 1,office 5             + 1404169200 +

The second shows all that have read the Briefing
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+  unique +     item *ID from Table 1*  + iduser  +    Date      +       
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+   1     +             4               + 129     +  1394169200  +
+   2     +             4               + 128     +  1394169200  +
+   3     +             4               + 127     +  1394169200  +
+   4     +             4               + 125     +  1394169200  +

Both work fine and are being used to show user that they have a brieifng to read. However i have been asked to add a list so when a manager searches a user it show all brieifings they need to read and mark those that have been read. 
The first query is easy 
$query ="SELECT * FROM `UPLOAD` WHERE Grade LIKE '%$GR%'//Grade of person being searched                                    
AND Location LIKE '%$LOC%'//location of person being searched
AND expiry > '$current'";//and they haven't expired
$query_result = mysql_query($query,$connection)                                 
or die("Couldn't execute query.");  
while($row = mysql_fetch_array($query_result))                           
{       
echo $row['item']."<br>";
}

This list all brieifngs no problems, Now i need to look for a row in the second table were table 2 item = table 1 id and table 2 iduser is the same as the person person being searched and add a tick or highlight it in some way. However i can't work it out.
There is more code above this that has the search ID from a $_POST and the PHP connection etc but i couldn't put it all on one page 

A:

To SELECT elements you can use something similar to
SELECT * FROM second_table_name
LEFT JOIN upload ON upload.id = second_table_name.item
WHERE second_table_name.userid = searched_person_id

Put correct value in place of second_table_name and searched_person_id

