From 4429576d38dfd4ade4e1702986f20373cf735c92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=A0=E3=81=84=E3=81=A1=E3=81=BE=E3=82=8B?= <98202777+Daichimarukana@users.noreply.github.com> Date: Thu, 17 Aug 2023 19:58:36 +0900 Subject: [PATCH] Delete reply directory --- reply/reply.php | 202 ------------------------------------------------ 1 file changed, 202 deletions(-) delete mode 100644 reply/reply.php diff --git a/reply/reply.php b/reply/reply.php deleted file mode 100644 index c85d25b..0000000 --- a/reply/reply.php +++ /dev/null @@ -1,202 +0,0 @@ -beginTransaction(); - - try { - - // SQL作成 - $stmt = $pdo->prepare("INSERT INTO ueuse (username, account, uniqid, rpuniqid, ueuse, photo1, photo2, video1, datetime, abi) VALUES (:username, :account, :uniqid, :rpuniqid, :ueuse, :photo1, :photo2, :video1, :datetime, :abi)"); - - $stmt->bindParam(':username', $username, PDO::PARAM_STR); - $stmt->bindParam(':account', $userid, PDO::PARAM_STR); - $stmt->bindParam(':uniqid', $uniqid, PDO::PARAM_STR); - $stmt->bindParam(':rpuniqid', $rpuniqid, PDO::PARAM_STR); - $stmt->bindParam(':ueuse', $Rptext, PDO::PARAM_STR); - - $stmt->bindParam(':photo1', $photo1, PDO::PARAM_STR); - $stmt->bindParam(':photo2', $photo2, PDO::PARAM_STR); - $stmt->bindParam(':video1', $video1, PDO::PARAM_STR); - $stmt->bindParam(':datetime', $datetime, PDO::PARAM_STR); - - $stmt->bindParam(':abi', $abi, PDO::PARAM_STR); - - // SQLクエリの実行 - $res = $stmt->execute(); - - // コミット - $res = $pdo->commit(); - - // 書き込み日時を取得 - $datetime = date("Y-m-d H:i:s"); - $title = ''.$userid.'さんが返信しました!' - $msg = ''.$userid.'さんがあなたの投稿に返信しました!' - $url = '/!'.$rpuniqid - - // トランザクション開始 - $pdo->beginTransaction(); - - $stmt = $pdo->prepare("INSERT INTO notification (touserid, title, msg, url, datetime) VALUES (:touserid, :title, :msg, :url, :datetime,)"); - - $stmt->bindParam(':touserid', $touserid, PDO::PARAM_STR); - $stmt->bindParam(':title', $title, PDO::PARAM_STR); - $stmt->bindParam(':msg', $msg, PDO::PARAM_STR); - $stmt->bindParam(':url', $url, PDO::PARAM_STR); - $stmt->bindParam(':datetime', $datetime, PDO::PARAM_STR); - - $res = $stmt->execute(); - $res = $pdo->commit(); - - } catch(Exception $e) { - - // エラーが発生した時はロールバック - $pdo->rollBack(); - } - - if ($res) { - header('Content-Type: application/json'); - echo json_encode(['success' => true]); - exit; - } else { - header('Content-Type: application/json'); - echo json_encode(['success' => false, 'error' => '追加に失敗しました。']); - exit; - } - } catch(PDOException $e) { - header('Content-Type: application/json'); - echo json_encode(['success' => false, 'error' => 'データベースエラー:' . $e->getMessage()]); - exit; - } - - if (!empty($errors)) { - header('Content-Type: application/json'); - echo json_encode(['success' => false, 'errors' => $errors]); - exit; - } - - - // プリペアドステートメントを削除 - $stmt = null; -} - - -?>