$i=0; do { $p.$i =$array[$i][uid]."/".$array[$i][filename]; $i++; } while ($row_topphotos = mysql_fetch_assoc($topphotos)); echo $p1;