You do know the number. If you're doing a mysql query, you can do something like:
PHP Code:
$result = mysql_query($query);
$rows = mysql_num_rows($result);
echo "&numResults=".$rows."&"
which will echo the number of rows returned, and then as you iterate through the rows you use the iteration number along with the column name thing... for example:
PHP Code:
$query = "SELECT * FROM myTable";
$result = mysql_query($query);
$rows = mysql_num_rows($result);
echo "&numResults=".$rows."&";
$i = 0;
while ($row = mysql_fetch_assoc($result)){
echo "&name".$i."=".$row['name']."&";
echo "&anotherfield".$i."=".$row['anotherfield']."&";
$i++;
}
Then in flash you know how many rows there are, numResults, and you cycle through from 0 to numResults-1, where each result is stored in columnamenumber, so if you want the 5th "name" result, it would be name4. Hope that makes sense.