<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');

try {
    $pdo = require 'config/database.php';
    echo "Connected successfully\n";

    echo "SERVICES:\n";
    $services = $pdo->query("SELECT id, service_name, slug FROM services")->fetchAll(PDO::FETCH_ASSOC);
    foreach ($services as $s) echo "{$s['id']}: {$s['service_name']} ({$s['slug']})\n";

    echo "\nLOCATIONS:\n";
    $locations = $pdo->query("SELECT id, name, slug FROM locations")->fetchAll(PDO::FETCH_ASSOC);
    foreach ($locations as $l) echo "{$l['id']}: {$l['name']} ({$l['slug']})\n";

    echo "\nSEO LANDINGS:\n";
    $landings = $pdo->query("SELECT id, slug, focus_keyword FROM seo_landings")->fetchAll(PDO::FETCH_ASSOC);
    foreach ($landings as $l) echo "{$l['id']}: {$l['slug']} - KW: {$l['focus_keyword']}\n";

} catch (Exception $e) {
    echo "ERROR: " . $e->getMessage() . "\n";
}
