try this
$countIndex = 1; // count file that increments for every new array call
while ($data = mysql_fetch_array($result))
{
printf("$countIndex. %s<br>\r, $data[0]");
$countIndex .= 1; //increments by one
}
not sure if all the syntax is correct i'm still pretty new to php.