PHP Mysql Query odd behavior?

Hello,

I’ve searched a number of forums but cannot seem to find an answer to my question.

I have reasonably extensive mysql query and php experience.

This is the query:
[php]//Query to get pull league, sport, and season registration information(tables are linked properly through referential integrity) for seasons which are set to be available for registration in the season table.
$query_text= "SELECT
*
FROM
leagues
Inner Join sports ON sports.sport_identifier = leagues.sport_identifier
Inner Join seasons ON seasons.season_identifier = leagues.season_identifier
WHERE seasons.bin_season_available_for_registration=1
";

$query = mysql_query($query_text);
$array = mysql_fetch_array($query);

print “

”;
var_dump($array);
print “
”;
[/php]

The print_r output is showing the following:
[tt]
Array
(
[0] => 4
[league_identifier] => 4
[1] => 1
[season_identifier] => 1
[2] => 1
[sport_identifier] => 1
[3] => 1
[league_day] => 1
[4] => Monday Beach Volleyball
[league_name] => Monday Beach Volleyball
[5] => 1000
[league_fee] => 1000
[6] => 1
[7] => Beach Volleyball
[sport_name] => Beach Volleyball
[8] => /test
[sport_master_logo] => /test
[9] => 12
[sport_number_of_players_for_registration] => 12
[10] => 1
[11] => Spring
[season_description] => Spring
[12] => 2011
[season_year] => 2011
[13] => 1
[bin_season_available_for_registration] => 1
[14] => 0
[bin_season_available_in_score_reporter] => 0
)
[/tt]

The problem is that there should be 3 records returned from that query. The same query code, tested in Navicat and PHPMyAdmin returns the correct/expected results.

I don’t understand why it is returning what appear to be duplicate values for the lone record it returns (it shows [array key] => [field value], and then [field name] => [field value].

Any help/assistance you could provide would be appreciated!

Additional information (not sure if it matters):

[ul][li]I’m using mysql v. 5.5.8 on WAMPSERVER installed on my localhost[/li]
[li]I’m testing in Google Chrome[/li][/ul]

Sponsor our Newsletter | Privacy Policy | Terms of Service