prepare("SELECT * FROM categories WHERE id = ?"); $stmt->execute([$id]); $cat = $stmt->fetch(); if (!$cat) { header("Location: index.php"); exit; } // Fetch products for this category $stmt = db()->prepare("SELECT p.*, c.name as category_name FROM products p JOIN categories c ON p.category_id = c.id WHERE p.category_id = ? AND p.is_active = 1 ORDER BY p.id DESC"); $stmt->execute([$id]); $cat_products = $stmt->fetchAll(); ?>

个商品

暂无相关商品

我们正在紧急补货中,请稍后再来。

返回首页