lapwing
Новичок
Помогите разобраться с циклом while.
Здравствуйте! Честно признаюсь понравилась галерея http://dev.herr-schuessler.de/jquery/popeye/demo.html. Решил прикрутить себе. Задача - вывод фоток к каждой записи. Вот код.
Фотки почему то выводятся один раз - с последней записью. Заголовок, сообщение, телефон, имя, т.е. все остальное предыдущих записей выводится нормально, только без фотографий. Подскажите почему?
Здравствуйте! Честно признаюсь понравилась галерея http://dev.herr-schuessler.de/jquery/popeye/demo.html. Решил прикрутить себе. Задача - вывод фоток к каждой записи. Вот код.
PHP:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<title></title>
<link rel="stylesheet" type="text/css" href="http://www.harthaus.ru/main.css" media="screen" />
<link rel="stylesheet" type="text/css" href="http://www.harthaus.ru/ppy/css/popeye/jquery.popeye.css" media="screen" />
<link rel="stylesheet" type="text/css" href="http://www.harthaus.ru/ppy/css/popeye/jquery.popeye.style.css" media="screen" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script type="text/javascript" src="http://www.harthaus.ru/ppy/lib/popeye/jquery.popeye-2.0.4.min.js"></script>
</head>
<body>
<div id="wrap">
<div id="content">
<?php include_once('../blocks/sidebar.php');?>
<div id="maincontent">
<?php
include_once("../../connection.php");
$result = mysql_query('SELECT heading,message,tel,name,path1big,path1small,path2big,path2small
FROM information WHERE operid = "s_kv" ORDER BY informid DESC
LIMIT '.$start_pos.','.$perpage)
or die('error Что то не выбирает');
while($row = mysql_fetch_array($result))
{
printf("
<div id='page-margins'>
<div class='example'>
<h3>".$row['heading']."</h3>
<div class='ppy' id='ppy2'>
<ul class='ppy-imglist'>
<li><a href='".$row['path1big']."'><img src='".$row['path1small']."' alt='Продажа квартир' /></a></li>
<li><a href='".$row['path2big']."'><img src='".$row['path2small']."' alt='Продажа квартир' /></a></li>
</ul>
<div class='ppy-outer'>
<div class='ppy-stage'>
<div class='ppy-counter'>
<strong class='ppy-current'></strong> / <strong class='ppy-total'></strong>
</div>
</div>
<div class='ppy-nav'>
<div class='nav-wrap'>
<a class='ppy-next' title='Следующая'>Следующая</a>
<a class='ppy-prev' title='Предыдущая'>Предыдущая</a>
<a class='ppy-switch-enlarge' title='Увеличить'>Увеличить</a>
<a class='ppy-switch-compact' title='Закрыть'>Закрыть</a>
</div>
</div>
</div>
</div>
<p>".$row['message']."<br /> </p>
<p>".$row['name']." Тел.".$row['tel']."<br /> </p>
</div>
</div>
<br />");
}
?>
</div>
<?php include_once('../blocks/p_sidebar.php');?>
</div
<br style="clear:both;" />
<?php include_once('../blocks/footer.php');?>
</div>
<!-- [example js] begin -->
<script type="text/javascript">
<!--//<![CDATA[
$(document).ready(function () {
var options2 = {
caption: false,
navigation: 'permanent',
direction: 'left'
}
var options3 = {
caption: 'permanent',
opacity: 1
}
$('#ppy1').popeye();
$('#ppy2').popeye(options2);
$('#ppy3').popeye(options3);
});
//]]>-->
</script>
<!-- [example js] end -->
</body>
</html>