From 27ec06033aa6ef6dc66e2666f6bd03cb5f3f4403 Mon Sep 17 00:00:00 2001 From: Marcel Peterkau Date: Mon, 28 Nov 2022 16:53:55 +0100 Subject: [PATCH] Bugfix - whises where always added to list 0 --- add_item.php | 5 +++-- index.php | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/add_item.php b/add_item.php index 032eeef..6ea35e6 100644 --- a/add_item.php +++ b/add_item.php @@ -9,6 +9,7 @@ $ItemDescription = $_POST['ItemDescription']; $ItemPrice = $_POST['ItemPrice']; $ItemLink = $_POST['ItemLink']; $ItemImage = $_POST['ItemImage']; +$ListID = $_POST['ItemListID']; #--- check if the provided Link is a valid URL @@ -41,13 +42,13 @@ if ($conn->connect_error) { die('Connection failed: ' . $conn->connect_error); } -$stmt = $conn->prepare('INSERT INTO whishes (title, description, link, image, price) VALUES (?, ?, ?, ?, ?)'); +$stmt = $conn->prepare('INSERT INTO whishes (title, description, link, image, price, whislist) VALUES (?, ?, ?, ?, ?, ?)'); if (false === $stmt) { die('prepare() failed: ' . htmlspecialchars($mysqli->error)); } -$rc = $stmt->bind_param('ssssi', $ItemTitle, $ItemDescription, $ItemLink, $imageLocalLink, $ItemPriceCents); +$rc = $stmt->bind_param('ssssii', $ItemTitle, $ItemDescription, $ItemLink, $imageLocalLink, $ItemPriceCents, $ListID); if (false === $rc) { die('bind_param() failed: ' . htmlspecialchars($stmt->error)); } diff --git a/index.php b/index.php index 7f8468d..98ad6d1 100644 --- a/index.php +++ b/index.php @@ -299,6 +299,7 @@ if (isset($_POST['delete']) && $loggedin == true) {