dongmeiwei0226 2017-03-15 11:18
浏览 17
已采纳

仅在特定类别中显示项目[重复]

on my database i have a category, how do I display a specific category only to be display on my php page ?

<?
            include("conn.php");
            $result=mysql_query("select * from products");
            while($row=mysql_fetch_array($result)){
                if(@$count % 2==0){
        ?>
        <table border="0" cellpadding="2px" width="1000px">
<?php } ?>


            <td width="500"><img src="gambar/<?=$row['Gambar']?>" />
                <br><b><?=$row['product_name']?></b><br />
                    <?=$row['description_name']?><br />
                    Price:<big style="color:green">
                        RM<?=$row['price']?></big><br /><br />

the code above display all the item in the database.

</div>
  • 写回答

2条回答 默认 最新

  • dongqing6755 2017-03-15 11:40
    关注

    Add where condition in query to filter Your result

     select * from products where category='books'
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 有没有帮写代码做实验仿真的
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥30 vmware exsi重置后登不上
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题
  • ¥20 yolov5自定义Prune报错,如何解决?
  • ¥15 电磁场的matlab仿真