projects
/
pics.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9f2fce3
)
Start tracking comments
author
Jacob Casper
<dev@jacobcasper.com>
Sat, 9 Apr 2022 21:15:32 +0000
(16:15 -0500)
committer
Jacob Casper
<dev@jacobcasper.com>
Sat, 9 Apr 2022 21:15:32 +0000
(16:15 -0500)
upload.php
patch
|
blob
|
blame
|
history
diff --git
a/upload.php
b/upload.php
index
883fa51
..
d69e283
100644
(file)
--- a/
upload.php
+++ b/
upload.php
@@
-47,6
+47,12
@@
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$post_stmt->bindValue(':id', $post_id);
$post_stmt->bindValue(':user', $user);
$post_stmt->bindValue(':time', $post_time);
$post_stmt->bindValue(':id', $post_id);
$post_stmt->bindValue(':user', $user);
$post_stmt->bindValue(':time', $post_time);
+
+ $comment_stmt = $db->prepare('INSERT into comments VALUES (:id, :post_id, :body)');
+ $comment_stmt->bindValue(':id', uuid_v4());
+ $comment_stmt->bindValue(':post_id', $post_id);
+ $comment_stmt->bindValue(':body', $_POST['comment'] ?? '');
+ $comment_stmt->execute();
$post_stmt->execute();
$db->exec('COMMIT');
$post_stmt->execute();
$db->exec('COMMIT');