while loop into in array

azeroth

New Member
What am I trying to do is collect data from a while loop, store it into a variable. Then later in my code I see if some variable is equal to one of the values in the array and then to echo out the two other column values I got from the while loop but equal to the row that the value came from. I have tried a bunch different things and am so close but cant get it exactly. \[code\] while($row = mysql_fetch_assoc($query)){$team[] .= "{$row['team']}";$winslosses .= "({$row['wins']} - {$row['losses']})";\[/code\]}
this returns something like\[code\] $team = (bears, badgers, wildcats) $winslosses = ((42-24), (55-23), (32-21))\[/code\]Then later in my code I want to see if its equal to a value in the array then echo $winslosses.\[code\] if(in_array(bears, $team) ) {echo '$winslosses';}\[/code\]This shows all the wins and losses from each team. I want it only show me the record of the bears.Any help would be great.
 
Top