I am writing a script that does wins/losses for sports games. I am trying to figure out how to display a win-loss record. My table in the MySQL Database has the following fields:
date
time
winningteam
losingteam
winningscore
losingscore
Each team is given a number to represent it (i.e. Chicago = 1, L.A. = 2, etc.
I am not sure how to count up how many times a team shows up in the winningteam column.
Example:
team 1 beats team 2 10-5, so the first record shows that:
winningteam = 1
losingteam = 2
etc.
team 2 beats team 1 9-8, so the second record shows the following:
winningteam = 2
losingteam = 1
so our table looks like
winningteam losingteam
1 2
2 1
if you count how many times team 1 shows up in the winningteam column, the result is 1. This is what i wish to show. How can you have php do that?