HaUser14 Мая 2014 $sql = mysql_query("SELECT * FROM `gallery_foto` WHERE `id_user` = '$ank[id]' ORDER BY `id` DESC LIMIT 4"); $coll=mysql_result(mysql_query("SELECT COUNT(*) FROM `gallery_foto` WHERE `id_user` = '$ank[id]' ORDER BY `id` DESC"),0);if ($coll>0){ while ($photo = mysql_fetch_assoc($sql)){ echo "<a href='/foto/$ank[id]/$photo[id_gallery]/$photo[id]/'><img src='/foto/foto50/$photo[id].$photo[ras]' alt='' width='40'/></a>"; } }