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.output set motor_state=? where num=? LIMIT 1"; $stmh = $pdo->prepare($sql); $stmh->bindValue(1, $motor_state, PDO::PARAM_STR); $stmh->bindValue(2, $num, PDO::PARAM_STR); //고유키값이 같나?의 의미로 ?로 num으로 맞춰야 합니다. where 구문 $stmh->execute(); $pdo->commit(); } catch (PDOException $Exception) { $pdo->rollBack(); print "오류: ".$Exception->getMessage(); } header("Location:/motororder/view.php?num=$num&page=$page&search=$search&find=$find&process=$process&yearcheckbox=$yearcheckbox&year=$year&fromdate=$fromdate&todate=$todate&separate_date=$separate_date"); ?>