【发布时间】:2016-09-09 13:09:50
【问题描述】:
我正在尝试从数据库中获取数据块后如何滑动它。 我尝试了很多但没有得到结果。请帮助我找出解决方案 这是我的代码
<html>
<head>
</head>
<body>
<?php
$servername="localhost";
$username="root";
$password="";
$db="lalcoresidency";
$conn=mysqli_connect($servername,$username,$password,$db);
if(!$conn){
die("connection failed:".mysqli_connect_error());
}
?>
<div class="flexslider">
<ul class="slides">
<?php
$query="select * from testimonial order by r_id desc";
$result = mysqli_query($conn, $query);
while($row=mysqli_fetch_array($result)){
?>
<li>
<?php echo $row['review'];?>
</li>
<?php
}
?>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
<script>
$(document).ready(function() {
$('.flexslider').carousel({
interval: 3200
});
});
</script>
</body>
这已经花费了我的时间,但我没有得到解决方案。此代码仅逐行显示数据
my code output
"Loving Staff Welcoming and helpful... Kind and welcome the food is great. Breakfast included."
"Total value for money."
"Excellent facilities with good location and very co-operative and efficient staff."
"Accommodation worth the money paid for... Staff were very helpful and in-house car hire rates were so reasonable."
"An excellent stay... Loved the stay and definitely look forward to keep going back for our next stay."
它一个一个地显示数据。但我想显示第一行数据,然后在滑动后显示第二行。然后在滑动第三行后。 请帮助我找到解决方案
【问题讨论】:
-
<div class="flexslider"><ul class="slides">关闭在哪里? -
在结束括号之后..
-
它不在您提供的代码中。
-
是的..在复制它被删除后,我试图将 div 放在右括号之后,但它给出了相同的答案