💻 Preisvergleich – Beispielanwendung
Kategorie:
Alle
> = htmlspecialchars($c['name']) ?>
Max Preis (€):
Anzeigen
0) { $sql .= " AND p.categoryID = ?"; $params[] = $categoryID; $types .= "i"; } if ($maxPrice > 0) { $sql .= " AND (o.price + o.shippingCost) <= ?"; $params[] = $maxPrice; $types .= "d"; } $sql .= " GROUP BY p.productID ORDER BY bestPrice ASC"; $stmt = mysqli_prepare($con, $sql); if ($params) { mysqli_stmt_bind_param($stmt, $types, ...$params); } mysqli_stmt_execute($stmt); $result = mysqli_stmt_get_result($stmt); // ====================================== // Ausgabe while ($p = mysqli_fetch_assoc($result)): ?>
= htmlspecialchars($p['brand']) ?> = htmlspecialchars($p['model']) ?>
Kategorie: = htmlspecialchars($p['category']) ?>
💰 Ab = number_format($p['bestPrice'], 2, ',', '.') ?> €
Specs:
"; } ?>
Angebote:
"; } ?>