Try this syntax for the query:
$query = "SELECT * FROM table_2 WHERE table_2.Name = table_1.Name";
$result = mysql_query($query);
I believe that would do it for the query string. Also on the while loop you might do a mysql_num_rows() on the result and the do a for loop like this:
$numresults = mysql_num_rows($$result);
for ($i = 0; $i < $numresults; $i++)
{
//code here
}
I think a for loop is faster as it is based on a count of an existing array. I could be way wrong on that too.
On the query part the fields names DO NOT have to be the same either. You could have:
$query = "SELECT * FROM table_2 WHERE table_2.Name = table_1.user";