It is necessary to pull out a number of values from the base. But in the beginning you need only the first, and then the whole set. I use the following code
$photoQwerry = mysql_query("SELECT PhotoPath FROM Photos WHERE ID=$id"); //берем первое значение из массива if($photoQwerry){ echo mysql_result($photoQwerry,0,'PhotoPath'); } ... //выводим весь массив if($photoQwerry){ while($photo = mysql_fetch_array($photoQwerry)){ echo "$photo[PhotoPath]"; } } Code simplified and removed too much, but the point in the output of images. The trouble is that the first query "eats" the first value and in the second output all data is output, except for the first line. How to fix it?