prepare($album_query); $stmt->bind_param("i", $album_id); $stmt->execute(); $album_result = $stmt->get_result(); if ($album_result->num_rows === 0) { $stmt->close(); $conn->close(); header('Location: gallery'); exit; } $album = $album_result->fetch_assoc(); $stmt->close(); // Fetch all photos in the album $photos_query = " SELECT photo_id, file_path, caption, display_order FROM photos WHERE album_id = ? ORDER BY display_order ASC "; $stmt = $conn->prepare($photos_query); $stmt->bind_param("i", $album_id); $stmt->execute(); $photos_result = $stmt->get_result(); $photos = []; if ($photos_result && $photos_result->num_rows > 0) { while ($row = $photos_result->fetch_assoc()) { $photos[] = $row; } } $stmt->close(); $conn->close(); ?> 'index.php'], ['Gallery' => 'gallery'], [$album['title'] => '#']]; require_once($rootPath . '/components/banner.php'); ?> Back to Gallery Edit Album 0): ?> $photo): ?> ✕ 1): ?> ❮ ❯ No photos in this album yet. Add Photos
No photos in this album yet.