초기 커밋: 5130 레거시 시스템
- URL 하드코딩 → .env APP_URL 기반 동적 URL로 변경 - DB 연결 하드코딩 → .env 기반으로 변경 - MySQL strict mode DATE 오류 수정
This commit is contained in:
48
make/save_check.php
Normal file
48
make/save_check.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
$num=$_REQUEST["num"]; // 전달인수가 변수명과 겹치면 오류가 발생해서 받아들이지 않는다.
|
||||
$left_check=$_REQUEST["left_check"];
|
||||
$right_check=$_REQUEST["right_check"];
|
||||
$mid_check=$_REQUEST["mid_check"];
|
||||
$done_check=$_REQUEST["done_check"];
|
||||
$remain_check=$_REQUEST["remain_check"];
|
||||
|
||||
|
||||
// print "<script> alert($modify); </script>";
|
||||
|
||||
require_once("../lib/mydb.php");
|
||||
$pdo = db_connect();
|
||||
try{
|
||||
$sql = "select * from chandj.make where num=?"; // get target record
|
||||
$stmh = $pdo->prepare($sql);
|
||||
$stmh->bindValue(1,$num,PDO::PARAM_STR);
|
||||
$stmh->execute();
|
||||
$row = $stmh->fetch(PDO::FETCH_ASSOC);
|
||||
} catch (PDOException $Exception) {
|
||||
$pdo->rollBack();
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
|
||||
try{
|
||||
$pdo->beginTransaction();
|
||||
$sql = "update chandj.make set left_check=?, mid_check=?, right_check=?, done_check=?, remain_check=? ";
|
||||
$sql .= " where num=? LIMIT 1";
|
||||
|
||||
|
||||
$stmh = $pdo->prepare($sql);
|
||||
|
||||
$stmh->bindValue(1, $left_check, PDO::PARAM_STR);
|
||||
$stmh->bindValue(2, $mid_check, PDO::PARAM_STR);
|
||||
$stmh->bindValue(3, $right_check, PDO::PARAM_STR);
|
||||
$stmh->bindValue(4, $done_check, PDO::PARAM_STR);
|
||||
$stmh->bindValue(5, $remain_check, PDO::PARAM_STR);
|
||||
$stmh->bindValue(6, $num, PDO::PARAM_STR);
|
||||
|
||||
$stmh->execute();
|
||||
$pdo->commit();
|
||||
} catch (PDOException $Exception) {
|
||||
$pdo->rollBack();
|
||||
print "오류: ".$Exception->getMessage();
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user