Fix wrong function call.

This commit is contained in:
Ceda EI 2018-07-01 15:46:48 +05:30
parent 1a19776abd
commit f718e3747d
1 changed files with 3 additions and 3 deletions

View File

@ -86,10 +86,10 @@ function add_requirement() {
die("Connection failed: " . $conn->connect_error);
}
$stmt = $conn->prepare("DELETE FROM req where id = ?;");
$stmt->bind('s', $item_id);
$stmt->bind_param('s', $item_id);
$stmt->execute();
$stmt = $conn->prepare("INSERT INTO req (id, name, quantity) VALUES (?,?,?);");
$stmt->bind('ssi', $item_id, $item_name, $quantity);
$stmt->bind_param('ssi', $item_id, $item_name, $quantity);
$stmt->execute();
$conn->close();
send_html("Added to requirements");
@ -106,7 +106,7 @@ function deposit(){
die("Connection failed: " . $conn->connect_error);
}
$stmt = $conn->prepare("UPDATE req set quantity = quantity - ? where id = ?;");
$stmt->bind('is', $item_id, $quantity);
$stmt->bind_param('is', $item_id, $quantity);
$stmt->execute();
$conn->close();
send_html("Deposited!");