$sql="SELECT NAME,PUNTI FROM punti_utente order by PUNTI desc";
$result=mysql_db_query("test",$sql,$id_conness);
$count = mysql_num_rows($result);

$display = 10; // numeri di risultati visibili in flash
$i = 0;
while ($row = mysql_fetch_array($result,MYSQL_ASSOC)) {
if($i < $display && $i < $count+1){
str_replace( "\n", "",$row[NAME]);
// flash output
print "&name$i=".$row[NAME]."&punti$i=".$row[PUNTI];
$i++;
}
}

Questa è una query che ho fatto x un gioco.
Nel .fla, ci sono i campi dinamici "name0"-"name9" e "punti0"-"punti9"