'error','message'=>'로그인 필요']); exit; } $id = (int)($_POST['commentId'] ?? 0); $content = trim($_POST['comment'] ?? ''); if ($id < 1 || $content === '') { echo json_encode(['status'=>'error','message'=>'잘못된 요청']); exit; } // 본인 댓글만 수정 $stmt = $pdo->prepare(" UPDATE kngil.qa_comments SET content = :content, mdt_dt = NOW() WHERE comment_id = :id AND commenter = :user "); $stmt->execute([ ':content' => $content, ':id' => $id, ':user' => $_SESSION['login']['user_id'] ]); echo json_encode(['status'=>'ok']);