aboutsummaryrefslogtreecommitdiff
path: root/report/update.php
diff options
context:
space:
mode:
Diffstat (limited to 'report/update.php')
-rw-r--r--report/update.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/report/update.php b/report/update.php
index 0fadb53..c8ef12b 100644
--- a/report/update.php
+++ b/report/update.php
@@ -7,8 +7,8 @@ require_once(LIBRARY_PATH . "/functions.php");
if(session_set()) {
$conn = new PDO($config['db']['dsn'], $config['db']['username'], $config['db']['password']);
$query = $_POST['id'] == "" ?
- $conn->prepare("INSERT INTO reports (author, title, description) VALUES (:user_id, :title, :description)")
- : $conn->prepare("UPDATE reports SET title=:title, description=:description WHERE id=:report_id");
+ $conn->prepare("INSERT INTO reports (author, title, description, bug) VALUES (:user_id, :title, :description, :bug_id)")
+ : $conn->prepare("UPDATE reports SET title=:title, description=:description, bug=:bug_id WHERE id=:report_id");
if($_POST['id'] == "") {
$query->bindParam(':user_id', $_SESSION['user_id']);
} else {
@@ -16,6 +16,7 @@ if(session_set()) {
}
$query->bindParam(':title', $_POST['title']);
$query->bindParam(':description', $_POST['description']);
+ $query->bindValue(':bug_id', $_POST['bug_id'] == "" ? null : $_POST['bug_id']);
if($query->execute()) {
echo "<h2>report submitted</h2>";
} else {