Hi all
I have a question which i'm sure is easy to answer, but I can't solve it. Please help.
I have data in the following mysql tables: referee (name, ref_id), games(team_1, team_2, venue, date, competition), official(game_id, ref_id, official_type), official_type(name_id, name). The links between the tables are:
games.game_id - official.game_id
official.official_type - official_type.name_id
official.ref_id - referee.ref_id
In the official table there can be up to four rows with the same game_id but all with different official_type's (1,2,3, or 4) which are drawn from official_type.name_id
I want to be able to display the following in a php page all on one row, and make it repeat according to the number of rows in the games table:
games.game_id, games.team_1, games.team_2, games.venue, games.date, games.competition, referee.name (where official_type = 1), referee.name (where official_type = 2), referee.name (where official_type = 3), referee.name (where official_type = 4)
I want my php output table to look something like this
<tr><td>game_id</td><td>team_1</td><td>team_2</td><td>venue</td><td>date</td><td>competition</td><td>name (official_type=1)</td><td>name (official_type=2)</td><td>name (official_type=3)</td><td>name (official_type=4)</td></tr>
Many thanks in advance