i want to display this slideshow dynamically  please help me. 
        I am getting more than
        3 images if i put dynamic code

        <div class="row">
        <div id="carousel-reviews" class="carousel slide" data-ride="carousel">

        <div class="carousel-inner">
        <div class="item active">
            <!-------------------------------->
            <div class="col-md-4 col-sm-6">
            <div class="block-text rel zmin">
            <a title="" href="#">Active1</a>

            </div>
            </div>

            <!-------------------------------->
            <div class="col-md-4 col-sm-6 hidden-xs">
            <div class="block-text rel zmin">
            <a title="" href="#">Avtive2</a>

            </div>
            </div>
            <!-------------------------------->
            <div class="col-md-4 col-sm-6 hidden-sm hidden-xs">
            <div class="block-text rel zmin">
            <a title="" href="#">Avtive3</a>

            </div>
            </div>
            <!-------------------------------->

        </div><!------------------------------//item1------------------------------->   

        </div> <!---carousel-reviews ---->


        <a class="left carousel-control" href="#carousel-reviews" role="button" data-slide="prev">
        <span class="glyphicon glyphicon-chevron-left"></span>
        </a>
        <a class="right carousel-control" href="#carousel-reviews" role="button" data-slide="next">
        <span class="glyphicon glyphicon-chevron-right"></span>
        </a>
   </div>

Recommended Answers

All 3 Replies

This is only the HTML code. Can you upload a working do on jsfiddle.net to see what is actually happening? Or provide ONLY the relevant code here?

<?php
include('db.php');
$sel = mysql_query("select * from alumini");
?>
        <div class="row">
            <div id="carousel-reviews" class="carousel slide" data-ride="carousel">
              <div class="carousel-inner">


  <?php

  while($row = mysql_fetch_array($sel)){
  ?>
                    <div class="item active">
                     <!-------------------------------->
                        <div class="col-md-4 col-sm-6">
                            <div class="block-text rel zmin">
                               <?php
                                echo $row['alumini_name'];

                                ?>

                            </div>
                        </div>


                </div><!------------------------------//item1------------------------------->   
    <?php

    }
    ?>


                </div> <!---carousel-reviews ---->

                <a class="left carousel-control" href="#carousel-reviews" role="button" data-slide="prev">
                    <span class="glyphicon glyphicon-chevron-left"></span>
                </a>
                <a class="right carousel-control" href="#carousel-reviews" role="button" data-slide="next">
                    <span class="glyphicon glyphicon-chevron-right"></span>
                </a>
            </div>

Maybe because there are more than 3 images in your database?

Try $sel = mysql_query("SELECT * FROM alumini LIMIT 3");

The LIMIT statment will only select 3 images.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.