菜单链接不起作用

时间:2018-01-05 13:08:48

标签: php mysql sql

我创建了一个数据来自数据库的菜单。

link href =' slider1.php /" 。 $ row [' cat_id']。 " /" 。 $ row ['产品']。 "'

我的问题是菜单链接没有显示或菜单链接无效。

slider1.php代码中的

为:

<?php 
    include('include/config.php');
    $cat = $_GET['cat_id'];
if(isset($cat)){
    if($stmt = $connection->prepare("SELECT 
                                     a.img_id, a.img_name, a.img_type, a.img_size,  b.ad_id, 
                                     b.cus_id, b.ad_name, c.customer, c.mobile,
                                     d.product category,
                                     e.product as subcategory,
                                     f.product as subcat
                                     FROM `image` a 
                                     INNER JOIN `advt` b
                                     ON a.ad_id=b.ad_id
                                     INNER JOIN `customer` c
                                     ON b.cus_id=c.cus_id
                                     INNER JOIN `category` d
                                    ON b.category = d.cat_id 
                                    INNER JOIN `category` e
                                    ON b.subcategory = e.cat_id 
                                    INNER JOIN `category` f
                                    ON b.subcat = f.cat_id AND d.cat_id = '$cat'
                                     GROUP BY b.ad_id
                                     ")){ 


           $stmt->execute(); 
           $stmt->store_result(); 
           $stmt->bind_result($img_id, $img_name, $img_type, $img_size, $ad_id, $cus_id, $ad_name, $customer, $mobile, $category, $subcategory, $subcat);   

           while($stmt->fetch()){ 
           ?>

            <tr class="example">

                <td><?php echo $ad_id; ?></td>
                <td><?php echo $img_name; ?></td>
                <td><?php echo $cus_id; ?></td>
                <td><?php echo $ad_name; ?></td>
                <td><?php echo $customer; ?></td>
                <td><?php echo $mobile; ?></td>
                <td><?php echo $category; ?></td>
                <td><?php echo $subcategory; ?></td>
                <td><?php echo $subcat; ?></td>
             </tr>

            <?php
           } 
           $stmt->close();
           } 
} 
?>

数据库提取:

enter image description here

菜单链接;

<li><a href='/root/as/slider1/" . $row['cat_id'] . "/" . $row['product'] . "'>" . $row['product'] . "</a></li>

0 个答案:

没有答案