User:RabiesTurtle/CodeHelp2

Background
I am trying to get a query working right. Check below for example.

Example tables
Items

Users

Example Code
$querySearch = "	SELECT i.Number, i.User1, i.User2, u.Name       FROM Items i, Users u		WHERE i.User1 = u.ID			AND i.User2 = u.ID"; $recordsetSearch = mysql_query($querySearch) or die("Search query failed");

while($data = mysql_fetch_array($recordsetSearch)) {	extract($data); echo $Number $ID $ID;

Explaination
Here is the issue. Basically the users are indexed with an ID which is fine, but since I am trying to substitute the actual username in place of the ID for both User1 and User2... I need to figure out a way to do this without having User1 replacing User2. The ID is shown in the display section twice as example showing where I want it to show UserName1 and UserName2.

Right now the first like would echo something like "1 Bill Bill" where I want it to do "1 Bill Ryan". Like I said, I know the echo has ID twice but I am just trying to give you an idea of what I want.

Let me know if you need more explanation. I should be able to do this in the query I believe. I could do it with a second query and a while statement manually going through each user ID till it matches and replacing it, but that would be hugely inefficient.