<?php
$db = new PDO('sqlite:climate.db');
$db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);

echo "=== Rows with non-empty image_time_series_url ===\n";
$stmt = $db->query("
    SELECT f.id, l.name as location, v.name as variable, p.range as period, f.image_time_series_url 
    FROM future_climate f 
    JOIN locations l ON f.location_id = l.id 
    JOIN variables v ON f.variable_id = v.id 
    JOIN periods p ON f.period_id = p.id 
    WHERE f.image_time_series_url IS NOT NULL AND f.image_time_series_url != ''
");
$rows = $stmt->fetchAll();
print_r($rows);
echo "Total rows: " . count($rows) . "\n";
