Have done that but basically I am confused with my query, I want a page which the player logged in can confirm there results with a checkbox. indMatch.player1ID and indMatch.player2ID both correspond to users.usernames,
An example is indMatch.player2ID = joe, users.username = joe, users.username = Joe Smith. I want to also do this for player1 so that the player viewing the results can see the real names.
Also in this query I want to select only the rows where indMatch.player2ID is equal to the session variable '$username' and indMatch.p2ConfirmResult is equal to zero.
http://www.squashcommunities.com/confirmResult.php
If someone could help me do this it would be a great help, I have enclosed my attempt below.
$findName = "SELECT indMatch.indMatchID,
indMatch.player1ID,
indMatch.player2ID,
indMatch.player1Sco,
indMatch.player2Sco,
indMatch.player1Comment,
indMatch.player2Comment,
indMatch.p1WinLoss,
indMatch.p2WinLoss,
indMatch.iMatchDate,
indMatch.p2ConfirmResult,
users.username,
users.playerName
FROM indMatch, users
WHERE indMatch.player2ID = '$username' AND indMatch.p2ConfirmResult = 0 AND indMatch.player1ID = users.username AND indMatch.player2ID = users.username";
$findPlayer = mysql_query($findName) or die(mysql_error());
print "<table border=1>\n<tr><th>Date</th><th>Player 1</th><th>Player 1 Score</th><th>Player 2</th><th>Player 2 Score</th><th>Player 1 Comment</th></tr>\n";
while($row=mysql_fetch_assoc($findPlayer)) {
print "<tr><td>{$row['iMatchDate']}</td><td><a href=\"playerDetails.php?username=$row[username]\">$row[playerName]</a></td><td>{$row['player1Sco']}</td><td><a href=\"playerDetails.php?username=$row[username]\">$row[playerName]</a></td><td>{$row['player2Sco']}</td><td>{$row['player1Comment']}</td><tr>\n";
}
print "</tr>" .
"</table>";
Edit: Also at the minute it is only showing one result when there should be two matches which contain $username as indMatch.player2ID.