From a6a7c3665a1e6b08e131abb0bbdfc541cb1d1ee0 Mon Sep 17 00:00:00 2001 From: BodgeMaster <> Date: Sun, 5 Sep 2021 08:12:42 +0200 Subject: [PATCH] added reply to backend --- threadr/board/submit.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/threadr/board/submit.php b/threadr/board/submit.php index de1d980..81ff7df 100644 --- a/threadr/board/submit.php +++ b/threadr/board/submit.php @@ -1,17 +1,22 @@

Please fill out both the title field and content box.

"; } + else { $error = false; $error_message = ""; if (!$error) { - $statement = $pdo->prepare("INSERT INTO posts (board_id, user_id, content, title) VALUES (:bid, :uid, :content, :title)"); - $result = $statement->execute(array('bid'=>$id, 'uid'=>$_SESSION[user_id], 'content'=>$content, 'title'=>$title)); + $statement = $pdo->prepare("INSERT INTO posts (board_id, user_id, content, title, reply_to) VALUES (:bid, :uid, :content, :title, :replyto)"); + $result = $statement->execute(array('bid'=>$id, 'uid'=>$_SESSION[user_id], 'content'=>$_POST['content'], 'title'=>$_POST['title'], 'replyto'=>$reply_to)); } if (!$result) { $error_message = "

Error: SQL error.

" . $statement->queryString . "
" . $statement->errorInfo()[2] . "
";