update forms

This commit is contained in:
/jedi/ 2019-02-24 11:45:21 +01:00
parent c2aed76eda
commit 34cf28a2b2
2 changed files with 4 additions and 4 deletions

View file

@ -126,10 +126,10 @@ switch($_GET["action"]) {
if(hasval($_POST["id"]) && hasval($_POST["was"])&& hasval($_POST["container"])) { if(hasval($_POST["id"]) && hasval($_POST["was"])&& hasval($_POST["container"])) {
/* Prepared statement, stage 1: prepare */ /* Prepared statement, stage 1: prepare */
$was=$_POST["was"]; $was=$_POST["was"];
if (!($stmt = $mysqli->prepare("UPDATE found_items SET was=?, wo=?, wann=?, container=? WHERE id = ?"))) { if (!($stmt = $mysqli->prepare("UPDATE found_items SET was=?, wo=?, wann=?, container=?, uid=? WHERE id = ?"))) {
$errormsg = "Prepare failed: (" . $mysqli->errno . ") " . $mysqli->error; $errormsg = "Prepare failed: (" . $mysqli->errno . ") " . $mysqli->error;
} }
if (!$stmt->bind_param("ssssi", $_POST["was"] , $_POST["wo"], $_POST["wann"], $_POST["container"], $_POST["id"])) { if (!$stmt->bind_param("sssssi", $_POST["was"] , $_POST["wo"], $_POST["wann"], $_POST["container"], $_POST["uid"], $_POST["id"])) {
$errormsg = "Binding parameters failed: (" . $stmt->errno . ") " . $stmt->error; $errormsg = "Binding parameters failed: (" . $stmt->errno . ") " . $stmt->error;
} }
if (!$stmt->execute()) { if (!$stmt->execute()) {

View file

@ -9,9 +9,9 @@
<div class="card-body"> <div class="card-body">
<form method="POST" action="" id="found_form"> <form method="POST" action="" id="found_form">
<p><input type="text" readonly="true" class="form-control" placeholder="ID" name="id" value="<?php echo $item["id"]; ?>"></p> <p><input type="text" readonly="true" class="form-control" placeholder="ID" name="id" value="<?php echo $item["id"]; ?>"></p>
<p><input type="text" readonly="true" class="form-control" placeholder="UID" name="uid" value="<?php echo $item["uid"]; ?>"></p> <p><input type="text" class="form-control" placeholder="UID" name="uid" value="<?php echo $item["uid"]; ?>"></p>
<p><input type="text" class="form-control" placeholder="WANN" name="wann" value="<?php echo $item["date"]; ?>"></p> <p><input type="text" class="form-control" placeholder="WANN" name="wann" value="<?php echo $item["date"]; ?>"></p>
<p><input type="text" class="form-control" placeholder="WO" name="wo" value="<?php echo $item["wo"]; ?>"></p> <p><input type="text" class="form-control" placeholder="KISTE" name="container" value="<?php echo $item["container"]; ?>"></p>
<p><input type="text" class="form-control" placeholder="WAS" name="was" value="<?php echo $item["was"]; ?>"></p> <p><input type="text" class="form-control" placeholder="WAS" name="was" value="<?php echo $item["was"]; ?>"></p>
<div class="form-group"> <div class="form-group">
<div class="input-group"> <div class="input-group">