Gracias por las respuestas!
Ya anda, al final, usé esto:
Código PHP:
$qry = "select * from foto where cat='123'"; # siempre se hayaran 7 resultados, por eso no le pongo límite
$ejecuta = mysql_query($qry);
$i=1;
while ($result=mysql_fetch_array($ejecuta)) {
$urlfoto[$i] = $result['file'];
++$i;
}
y
Código PHP:
echo $urlfoto[1];
echo $urlfoto[2];
....