How do i get it to display more than 1 record?

I have this code to display records from my MySQL db in a dynamic text box in flash, but it only shows the first record and i want it to show all of them.

< ?  
   $database = "football";  
   $connessione = mysql_connect("localhost","username","password") or die ("Server non trovato");  
   mysql_select_db($database);  
     
   $query = "SELECT * FROM players WHERE goals>=1 ORDER BY goals DESC, name ASC";  
     
   $result = mysql_query($query) or die ("Error in query");  
     
   $num_rows = mysql_num_rows($result);     
        
   for($i=0;$i<$num_rows;$i++){  
     
      $row = mysql_fetch_array($result);        

      $name = "name$i";  
      $name = $row['name'];  
        
      $goals = "goals$i";  
      $goals = $row['goals'];  
        
      print("&news$i=$name $goals");  
              
   }  
     
   mysql_close($connessione);  
     
? >

It is doing what i want it to do, as in display the fields from my table of my db.

what i want it to do now is adapt this script so it has some kind of loop to display all the records in the same text box rather then just the first record in the table.

When i read the php in my browser it displays all the records i want, but only shows the first record in flash.

What code would i need to have and where would it go in the existing code i have.

Thanx

  • Lee