diff --git a/ad_recommendation.php b/ad_recommendation.php index 8b13789..fa180da 100644 --- a/ad_recommendation.php +++ b/ad_recommendation.php @@ -1 +1,179 @@ +query(" + SELECT productID, model, description, imagePath + FROM products + ORDER BY RAND() + LIMIT 1 +"); + +if ($stmt && $stmt->num_rows > 0) { + $randomProduct = $stmt->fetch_assoc(); + $rID = (int)$randomProduct['productID']; + $rModel = htmlspecialchars($randomProduct['model'] ?? ''); + $rDesc = htmlspecialchars($randomProduct['description'] ?? ''); + $rImg = htmlspecialchars($randomProduct['imagePath'] ?? 'assets/images/placeholder.png'); + ?> + + +
+
+
+ Empfehlung des Tages +

+

120) ? mb_substr($rDesc, 0, 120) . '...' : $rDesc ?>

+ Jetzt ansehen › +
+
+ <?= $rModel ?> +
+
+
+ diff --git a/index.php b/index.php index 71340cf..2a7f043 100644 --- a/index.php +++ b/index.php @@ -6,7 +6,15 @@ require_once __DIR__ . '/lib/bootstrap.php'; + + -