PDA

View Full Version : How would I do this?


Adrian Schneider
03-26-2005, 05:08 AM
...

Here is my query so far.
SELECT team.manager, team.managerid, team.batsmanid1, stats1.score AS batsman1score, stats2.score AS batsman2score

FROM fc_team team, fc_player_stats stats1, fc_player_stats stats2

WHERE gameid=7 AND team.batsmanid1=stats1.playerid AND team.batsmanid2=stats2.playerid

ORDER BY manager ASC

This returns 25 rows (most of which are the same) for a 2 match game. (each match has different statistics).


Well anyway, what I want to do is get a row (physical not db) that has manager and score (every player on teams score (or in this example, batsman1 and batsman2) and total them, for every match ). I'm not sure how would combine for/while/foreach to get this to work.

Displaying it and the math is the easy, I just need some help getting around how to sort through all the extra junk.

Sorry if I left out any major details, I'm tired. :ermm:

*Bump*