Problem creating array from MySql query

From: Date: Mon, 17 Feb 2003 15:04:30 +0000
Subject: Problem creating array from MySql query
Groups: php.general 
Request: Send a blank email to php-general+get-135835@lists.php.net to get a copy of this message
What we are trying to do is build an array from a query. I don't understand why but this is failing on the line "$affiliations[] = $affiliation_row["affiliation"];" Basically there are two tables in the database, since clubs can have multiple affiliations and the affiliations are not set in stone, there is one table only for affiliations. We are trying to pull the data out of the table for editing. Any tips would be appreciated. Thanks! $affiliation_result = mysql_query("SELECT affiliation FROM club_affiliations WHERE club_id=$id"); $affiliations = array(); print "Populating array..."; //place affiliation data into an array that we can search later while($affiliation_row = mysql_fetch_array($affiliation_result)) { print $affiliation_row["affiliation"]; $affiliations[] = $affiliation_row["affiliation"]; } //while -- Janyne Kizer

« previous php.general (#135835) next »