Combine 3 MySql rows into one PHP output row ?
| From: | CF High | Date: | Sun, 26 Jan 2003 21:29:22 +0000 |
| Subject: | Combine 3 MySql rows into one PHP output row ? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-133182@lists.php.net to get a copy of this message | ||
Hey all.
I'm a recent PHP convert (coming from Cold Fusion)..........
Here's the deal:
I've got a table that contains hockey game result info; for each goal
scored I record the goal scorer ID (i.e. their Jersey Number), and assist1
and assist2 IDs if applicable. When I output the game box score I join in
the roster and team tables (to get the team name and player names).
In Cold Fusion I was able to group a goal info set on the time of goal (each
goal returns from 1 to 3 rows depending on the number of players who
contributed to the goal); then, in Cold Fusion I could use it's output
function to display the goal info set as one row.
For example, if three players were in on a goal, the output would look
something like:
Team Name-- goal scorer name (assist1 name, assist2 name) -- Time of goal --
Goal type.
Since each goal can, and usualy does, have more than one participant, the
scoring table will be returning more than one row for each goal scored --
how can I combine these rows into one PHP output row?
If you need more info, let me know.
Thanks for any ideas,
--Noah
--