prepare('INSERT INTO institutions (name) VALUES (?)'); $stmt->execute([$name]); } } elseif (isset($_POST['update_institution'])) { $name = trim($_POST['name']); if (!empty($name) && !empty($id)) { $stmt = $pdo->prepare('UPDATE institutions SET name = ? WHERE id = ?'); $stmt->execute([$name, $id]); } header('Location: admin_institutions.php'); exit; } elseif (isset($_POST['delete_institution'])) { if (!empty($id)) { $stmt = $pdo->prepare('DELETE FROM institutions WHERE id = ?'); $stmt->execute([$id]); } header('Location: admin_institutions.php'); exit; } } ?>
Are you sure you want to delete the institution ""?
| ID | Name | Actions |
|---|---|---|
| " . htmlspecialchars($row['id']) . " | "; echo "" . htmlspecialchars($row['name']) . " | "; echo 'Edit Delete | '; echo "