As your thread topic title hints, store the name in a variable:
$result = mysql_query("SELECT name FROM members WHERE username = '$user' LIMIT 1");
$ownername = mysql_result($result, 0);
echo "<table>";
echo "<tr>";
echo "<td>" . htmlspecialchars($ownername) ."</td>\n";
echo "</tr>";
echo "</table>";