diff --git a/productpage.php b/productpage.php index bf49ab3..12dc47b 100644 --- a/productpage.php +++ b/productpage.php @@ -98,10 +98,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['delete_review']) && i p.categoryID FROM products p - INNER JOIN categoryAttributes ca + LEFT JOIN categoryAttributes ca ON p.categoryID = ca.categoryID - INNER JOIN attributes a + LEFT JOIN attributes a ON ca.attributeID = a.attributeID LEFT JOIN productAttributes pa @@ -119,6 +119,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['delete_review']) && i $result = $stmt->get_result(); $product = $result->fetch_assoc(); + if (!$product) { + die("Produkt nicht gefunden."); + } $categoryId = $product['categoryID']; /** @@ -357,7 +360,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
{$row['name']}: "; - if (!empty($row['valueString'])) echo $row['valueString']; - if (!empty($row['valueNumber'])) echo $row['valueNumber'] . " " . $row['unit']; + if (!empty($row['valueString'])) echo htmlspecialchars($row['valueString']); + if (!empty($row['valueNumber'])) echo htmlspecialchars($row['valueNumber'] . " " . $row['unit']); if (!is_null($row['valueBool'])) echo $row['valueBool'] ? "Ja" : "Nein"; echo "
"; }