From: "Dan Joseph" <[EMAIL PROTECTED]> > > In order to get all of the data back you are going to have to loop > > through it and return the array so that it will be available for > > manipulation. > > Hmm.. I suspected this might be the case. I have modified my > functiona bit: > > function selectRows( $sql ) > { > $count = 0; > > $results = mysql_query( $sql, DB::connect() ); > > while ( $data = mysql_fetch_array( $results ) ) > { > foreach ( $data as $name => $value ) > { > $array[$count][$name] = $value; > } > > $count++; > } > > return $array; > }
Change that to: $array = array(); $results = mysql_query( $sql, DB::connect() ); while($data = mysql_fetch_array($result)) { $array[] = $data; } return $array; No need to loop through $data. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php