Fix add wish error

This commit is contained in:
Jay 2022-03-09 20:21:27 +01:00
parent 4315957957
commit e96edb4880

View file

@ -52,6 +52,12 @@ switch ($_SERVER['REQUEST_METHOD']) {
break; break;
} }
$wishlist_id = $_POST['wishlist_id'];
$wish_title = trim($_POST['wish_title']);
$wish_description = $_POST['wish_description'] ?: 'NULL';
$wish_url = trim($_POST['wish_url']);
$wish_priority = $_POST['wish_priority'] ?: 'NULL';
$database->query('INSERT INTO `wishes` $database->query('INSERT INTO `wishes`
( (
`wishlist`, `wishlist`,
@ -60,11 +66,11 @@ switch ($_SERVER['REQUEST_METHOD']) {
`url`, `url`,
`priority` `priority`
) VALUES (' ) VALUES ('
. $_POST['wishlist_id'] . ', . $wishlist_id . ',
"' . trim($_POST['wish_title']) . '", "' . $wish_title . '",
"' . trim($_POST['wish_description']) . '", "' . $wish_description . '",
"' . trim($_POST['wish_url']) . '", "' . $wish_url . '",
' . trim($_POST['wish_priority']) . ' ' . $wish_priority . '
) )
;'); ;');