beginTransaction(); $sql = "update " . $DB . "." . $tablename . " SET registedate = ?, receiver = ?, receiver_tel = ?, address = ?, siteDate = ?, siteAttendance = ?, siteStatus = ?, quantityJson = ?, fee = ?, siteresult = ?, memo = ?, update_log = ?, searchtag = ?, secondord=?, secondordnum=?, workplacename=?, estimatedbyPerson=? , bidDate=?, totalitem=?, participantJson=? WHERE num = ? LIMIT 1"; $stmh = $pdo->prepare($sql); // 바인딩 $stmh->bindValue(1, $registedate, PDO::PARAM_STR); $stmh->bindValue(2, $receiver, PDO::PARAM_STR); $stmh->bindValue(3, $receiver_tel, PDO::PARAM_STR); $stmh->bindValue(4, $address, PDO::PARAM_STR); $stmh->bindValue(5, $siteDate, PDO::PARAM_STR); $stmh->bindValue(6, $siteAttendance, PDO::PARAM_STR); $stmh->bindValue(7, $siteStatus, PDO::PARAM_STR); $stmh->bindValue(8, $quantityJson, PDO::PARAM_STR); $stmh->bindValue(9, str_replace(',', '', $fee), PDO::PARAM_STR); $stmh->bindValue(10, $siteresult, PDO::PARAM_STR); $stmh->bindValue(11, $memo, PDO::PARAM_STR); $stmh->bindValue(12, $update_log, PDO::PARAM_STR); $stmh->bindValue(13, $searchtag, PDO::PARAM_STR); $stmh->bindValue(14, $secondord, PDO::PARAM_STR); $stmh->bindValue(15, $secondordnum, PDO::PARAM_STR); $stmh->bindValue(16, $workplacename, PDO::PARAM_STR); $stmh->bindValue(17, $estimatedbyPerson, PDO::PARAM_STR); $stmh->bindValue(18, $bidDate, PDO::PARAM_STR); $stmh->bindValue(19, $totalitem, PDO::PARAM_STR); $stmh->bindValue(20, $participantJson, PDO::PARAM_STR); $stmh->bindValue(21, $num, PDO::PARAM_INT); $stmh->execute(); $pdo->commit(); } catch (PDOException $Exception) { $pdo->rollBack(); echo json_encode(["error" => $Exception->getMessage()], JSON_UNESCAPED_UNICODE); exit; } } if ($mode == "insert" || $mode == "copy" || $mode == '' || $mode == null) { try { $pdo->beginTransaction(); $sql = "INSERT INTO " . $DB . "." . $tablename . " ( registedate, receiver, receiver_tel, address, siteDate, siteAttendance, siteStatus, quantityJson, fee, siteresult, memo, update_log, searchtag, secondord, secondordnum, workplacename, estimatedbyPerson, bidDate, totalitem, participantJson) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" ; $stmh = $pdo->prepare($sql); $stmh->bindValue(1, $registedate, PDO::PARAM_STR); $stmh->bindValue(2, $receiver, PDO::PARAM_STR); $stmh->bindValue(3, $receiver_tel, PDO::PARAM_STR); $stmh->bindValue(4, $address, PDO::PARAM_STR); $stmh->bindValue(5, $siteDate, PDO::PARAM_STR); $stmh->bindValue(6, $siteAttendance, PDO::PARAM_STR); $stmh->bindValue(7, $siteStatus, PDO::PARAM_STR); $stmh->bindValue(8, $quantityJson, PDO::PARAM_STR); $stmh->bindValue(9, str_replace(',', '', $fee), PDO::PARAM_STR); $stmh->bindValue(10, $siteresult, PDO::PARAM_STR); $stmh->bindValue(11, $memo, PDO::PARAM_STR); $stmh->bindValue(12, $update_log, PDO::PARAM_STR); $stmh->bindValue(13, $searchtag, PDO::PARAM_STR); $stmh->bindValue(14, $secondord, PDO::PARAM_STR); $stmh->bindValue(15, $secondordnum, PDO::PARAM_STR); $stmh->bindValue(16, $workplacename, PDO::PARAM_STR); $stmh->bindValue(17, $estimatedbyPerson, PDO::PARAM_STR); $stmh->bindValue(18, $bidDate, PDO::PARAM_STR); $stmh->bindValue(19, $totalitem, PDO::PARAM_STR); $stmh->bindValue(20, $participantJson, PDO::PARAM_STR); $stmh->execute(); $pdo->commit(); } catch (PDOException $Exception) { $pdo->rollBack(); echo json_encode(["error" => $Exception->getMessage()], JSON_UNESCAPED_UNICODE); exit; } } if ($mode == "delete") { try { $pdo->beginTransaction(); $sql = "update " . $DB . "." . $tablename . " SET is_deleted = 1 WHERE num = ?"; $stmh = $pdo->prepare($sql); $stmh->bindValue(1, $num, PDO::PARAM_INT); $stmh->execute(); $pdo->commit(); } catch (PDOException $ex) { $pdo->rollBack(); echo json_encode(["error" => $ex->getMessage()], JSON_UNESCAPED_UNICODE); exit; } } // JSON 응답 $data = [ 'num' => $num, 'mode' => $mode, 'receiver' => $receiver, 'receiver_tel' => $receiver_tel, 'address' => $address, 'siteDate' => $siteDate, 'siteAttendance' => $siteAttendance, 'siteStatus' => $siteStatus, 'quantityJson' => $quantityJson, 'bidDate' => $bidDate, 'fee' => $fee, 'siteresult' => $siteresult, 'totalitem' => $totalitem, 'memo' => $memo, 'participantJson' => $participantJson ]; echo json_encode($data, JSON_UNESCAPED_UNICODE); ?>