prepare("UPDATE school SET SCHOOL_NAME = ? WHERE SCHOOL_CODE = ?"); $stmt->execute([$name, $id]); header("Location: schools.php"); exit(); } catch(PDOException $e) { die("Update failed: " . $e->getMessage()); } } try { $id = $_GET['id']; $stmt = $pdo->prepare("SELECT * FROM school WHERE SCHOOL_CODE = ?"); $stmt->execute([$id]); $school = $stmt->fetch(); if(!$school) die("School not found"); } catch(PDOException $e) { die("Error fetching school: " . $e->getMessage()); } require_once '../pages/school_manage/header.php'; ?>