beginTransaction(); $sql = "UPDATE " . $DB . "." . $tablename . " SET recordsheet = ?, update_log = ? WHERE num = ? LIMIT 1"; $stmh = $pdo->prepare($sql); $stmh->bindValue(1, json_encode($recordsheet_jsondata), PDO::PARAM_STR); // recordsheet 저장 $stmh->bindValue(2, $update_log, PDO::PARAM_STR); // update_log 저장 $stmh->bindValue(3, $num, PDO::PARAM_STR); $stmh->execute(); $pdo->commit(); } catch (PDOException $Exception) { $pdo->rollBack(); print "오류: " . $Exception->getMessage(); } // 최종 결과 데이터 반환 $data = [ 'num' => $num, 'mode' => $mode, 'recordsheet' => $recordsheet_jsondata, 'update_log' => $update_log ]; echo json_encode($data, JSON_UNESCAPED_UNICODE); ?>