I need to pull up all [b]distinct[/b] userid_numbers out of [i]table1[/i] (To see who is online and in that location, excluding duplicate results), and then query [i]table2[/i] for each userid_number to get profile information, and then display in a table on the website. So basically, I need to join these two queries... [code]$query1 = "SELECT DISTINCT usernumber FROM table1 WHERE useronline_location='$location'";[/code] to get the list of usernumbers (in an array?)... then run the following query in a loop, so it gets the information for each usernumber... [code]$query2 = "SELECT * FROM table2 WHERE uidnum='$usernumber'"; // Display table here [/code] Can somebody assist? Thanks