php - Is it possible to add jQuery slider to come from the DB? -
i'm trying jquery slider come database display in html.
slider in html: http://puu.sh/ccd3x/7421da5d3a.jpg
my database: http://puu.sh/ccd5w/fe9465a903.png
this code it:
<div class="slider_bg"> <div class="wrap"> <div class="wrapper"> <div class="slider"> <!-- #camera_wrap_1 --> <div class="fluid_container"> <div class="camera_wrap camera_azure_skin" id="camera_wrap_1"> <div data-thumb="../images/thumbs/slider1.jpg" data-src="../images/slider/slider1.jpg"> </div> <div data-thumb="../images/thumbs/slider2.jpg" data-src="../images/slider/slider2.jpg"> </div> <div data-thumb="../images/thumbs/slider3.jpg" data-src="../images/slider/slider3.jpg"> </div> <div data-thumb="../images/thumbs/slider4.jpg" data-src="../images/slider/slider4.jpg"> </div> </div><!-- #camera_wrap_1 --> <div class="clear"></div> </div> <!-- end #camera_wrap_1 --> <div class="clear"></div> </div> </div> </div> </div>
what thought code work:
<?php $sql = "select image product productid=2"; $result = mysql_query($sql) or die(mysql_error($connection)); while ($row = mysql_fetch_array($result)) //display results { echo "<a href='../images/".$row['image']."'><img src='../images/".$row['image']."' /></a>"; } ?>
any help appreciated!
<?php $sql = "select image product productid=2"; $result = mysql_query($sql) or die(mysql_error($connection)); ?> <div class="slider_bg"> <div class="wrap"> <div class="wrapper"> <div class="slider"> <!-- #camera_wrap_1 --> <div class="fluid_container"> <div class="camera_wrap camera_azure_skin" id="camera_wrap_1"> <?php while($row = mysql_fetch_array($result)): //display results ?> <div data-thumb="../images/thumbs/<?php echo $row['image']; ?>" data-src="../images/slider/<?php echo $row['image']; ?>"> </div> <?php endwhile; ?> </div><!-- #camera_wrap_1 --> <div class="clear"></div> </div> <!-- end #camera_wrap_1 --> <div class="clear"></div> </div> </div> </div> </div>
php mysql
No comments:
Post a Comment