I am having a problem with a sql statement using the SELECT DISTINCT. It is only pulling one result from the database when printing the array. Here is the results.
Array ( [0] => 99796-Sponsors [team] => 99796-Sponsors )
Here is the results through myphpadmin
99796-Sponsors
98614-KDP / Future Educators
98239-For Riley
97008-Milan
94795-Team Hope
93583-The Ventilators
93079-Samantha's Team of Love
92200-Chelsea Rainbows
91804-Team Hayden
90293-Individual Walkers - Dalton
Here is the code I am trying to use:
PHP Code:
$select_teams = "SELECT DISTINCT team FROM great_strides WHERE file_name = '$_POST[file]'";
$query_teams = mysql_query($select_teams) or die("A MySQL error has occurred.<br />Your Query: " . $your_query . "<br /> Error: (" . mysql_errno() . ") " . mysql_error());
$results_teams = mysql_fetch_array($query_teams);
foreach($results_teams as $team) {
$select_team_leader="SELECT * FROM great_strides WHERE team = '$team' AND position= 'Team Leader'";
Does anyone know why I am only getting the one result and not all possibles?