prepare($sql); $stmh->bindValue(1, $num, PDO::PARAM_INT); $stmh->execute(); $row = $stmh->fetch(PDO::FETCH_ASSOC); if ($row) { $title = isset($row['title']) ? $row['title'] : ''; $registdate = isset($row['registdate']) ? $row['registdate'] : ''; $itemsep = isset($row['itemsep']) ? $row['itemsep'] : ''; $specialday = isset($row['specialday']) ? $row['specialday'] : ''; $yearlyspecialday = isset($row['yearlyspecialday']) ? $row['yearlyspecialday'] : ''; // Determine which period type to show based on saved data $isYearly = !empty($yearlyspecialday); // 매년 값이 있는지 판단 if ($isYearly) { // Split yearlyspecialday if available list($month, $day) = explode('/', $yearlyspecialday); } else { $month = 1; $day = 1; } $first_writer = isset($row['first_writer']) ? $row['first_writer'] : ''; $update_log = isset($row['update_log']) ? $row['update_log'] : ''; $searchtag = isset($row['searchtag']) ? $row['searchtag'] : ''; } else { echo "Record not found."; exit; } } else { $title = ''; $registdate = date('Y-m-d'); $itemsep = ''; $specialday = ''; $month = 1; // Default month for yearlyspecialday $day = 1; // Default day for yearlyspecialday $first_writer = $user_name; $update_log = ''; $searchtag = ''; $isYearly = false; // Default to monthly if no data } } catch (PDOException $Exception) { echo "오류: " . $Exception->getMessage(); exit; } ?>
| 등록일자 | 작성자 | ||
| 주기 |
onchange="toggleDateFields()"> 매년
onchange="toggleDateFields()"> 매월
|
||
| 내용 | |||