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'); + ?> + + +
= (mb_strlen($rDesc) > 120) ? mb_substr($rDesc, 0, 120) . '...' : $rDesc ?>
+ Jetzt ansehen › +