query("SELECT * FROM banners ORDER BY created_at DESC"); $banners = $stmt->fetchAll(PDO::FETCH_ASSOC); } elseif ($conn instanceof mysqli) { $result = $conn->query("SELECT * FROM banners ORDER BY created_at DESC"); if ($result && $result->num_rows > 0) { while ($row = $result->fetch_assoc()) { $banners[] = $row; } } } else { throw new Exception("Unsupported database connection type."); } } catch (Exception $e) { $banners = []; } ?>