我的類別名稱是我的導航欄。我想在categories.php頁面上顯示「categoryname」,同時點擊任何導航項目。categories.php頁面不是從DATABASE收集數據
- 頁面與數據庫連接
- 它正在創建動態鏈接
- 我檢查的SQL查詢,其工作
//this is categories.php file
<?php require ('includes/dbconnect.php');?>
<?php
if (!isset($_GET['categoryid'])){
header ("location:index.php");
}
$cat_sqli ="SELECT products.productid,products.productname,products.unit,products.price,products.brand,products.productdetails,categories.categoryid,categories.categoryname
FROM products
INNER JOIN categories ON (products.categoryid=categories.categoryid)
FROM products
INNER JOIN categories
ON (products.categoryid=categories.categoryid)
WHERE products.categoryid=".$_GET['categoryid'];
if ($cat_query = mysqli_query ($dbconnect,$cat_sqli)){
$cat_rs=mysqli_fetch_assoc($cat_query);
}
?>
<body>
<h1>Selected category | <?php echo $cat_rs['categoryname'];?></h1>
</body>
要解決這個問題請提供全部代碼與數據庫然後我會檢查本地結束 –