query(" SELECT p.productID, p.model, p.description, p.imagePath, MIN(o.price) as minPrice FROM products p LEFT JOIN offers o ON p.productID = o.productID GROUP BY p.productID 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'); $rPriceRaw = $randomProduct['minPrice']; $rPriceFormatted = $rPriceRaw ? number_format((float)$rPriceRaw, 2, ',', '.') : '100,00'; ?>
= $descShort ?>
Jetzt ansehen ›