如何在php中创建电子商务网站相关产品滑块

时间:2015-08-18 05:20:58

标签: javascript php slider e-commerce

我使用PHP创建了一个电子商务网站,我想创建一个相关的产品滑块。制作滑块的最佳方法是什么?

这是我的样本编码:

<?php
$select = mysql_query("select * from product where categories ='$categories' limit 4");

while($rows = mysql_fetch_array($select)) {
    $p_id = $rows['product_id'];
    $p_img = $rows['image'];
    $p_color = $rows['color'];
    $p_name = $rows['product_name'];
    $p_desc = $rows['product_detsils'];
    $categories = $rows['categories'];
    $p_offer = $rows['offer'];
    $p_price = $rows['buying_price'];

//**** related products slider here ****//

}
?>

1 个答案:

答案 0 :(得分:0)

<div class="item active">
                    <ul class="thumbnails">
                        <div class="col-md-3">
                            <div class="thumbnail">
                                <a href="product.php?product_id=<?php echo $p_id; ?>" style="text-decoration:none;color:#333;">
                                <img src="images/<?php echo $p_img;?>.jpg" alt="products"  />

                            <div class="caption">
                                <p style="font-size:11px;"><?php echo $p_name;?></p>
                                <p style="font-size:11px;"><?php echo $p_desc;?></p>
                                </a>
                                <center>
                                    <input class="add-cart btn btn-warning btn-sm" type="button" value="Add Cart" />
                                </center>
                            </div>
                            </div>
                        </div>  
                    </ul>

                </div><!--item active end-->