我需要帮助获取视频动态使用php mysql,我需要指示器的帮助:
<li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
和class "active item"
下面的代码我使用了
<?php
$sql = "SELECT aaa, ddd, fff, ggg FROM table ASC LIMIT 0, 20";
$result = mysql_query($sql);
?>
<h4>Upcoming Films:</h4>
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
</ol>
<div class="carousel-inner">
<?php
while($row = mysql_fetch_array($result))
{
$aaa=$row['aaa'];
$ddd=$row['ddd'];
$fff=$row['fff'];
$video=$row['video'];
?>
<!-- Wrapper for slides -->
<div class="item">
<iframe width="750" height="422" src="http://www.youtube.com/embed/<?php echo"$video";?>" frameborder="0" allowfullscreen></iframe>
</div>
<?php
}
?>
</div>
<!-- Controls -->
<a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left"></span>
</a>
<a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right"></span>
</a>
</div>
<?php
mysql_free_result($result);
mysql_close();
?>
<div class=
<?php
echo '"';
echo 'item ';
if ($i == 1) {
echo 'active';
}
echo '"';
?>>
content to loop
然后<?php
$i++;
}
?>