$p=mysql_fetch_array(mysql_query("SELECT * FROM `gallery_foto` WHERE `id` = '$f[lenta]' LIMIT 1")); /// определяем фото