Well without modifying your table your example would just work if you chage it like:
[sql]SELECT team.batsmanid1, player1.name AS name1, team.batsmanid2, player2.name AS name2
FROM fc_team team, fc_player player1, fc_player player2
WHERE team.batsmanid1=player1.id
AND team.batsmanid2=player2.id
AND team.id=$teamid
[/sql]
The question is if you really want the tables to stay like this. How many players you can have in a team? Is this a fixed number?
|