<?php
$pdo = require 'config/database.php';

echo "BLOG POSTS SEO:\n";
$posts = $pdo->query("
    SELECT p.id, p.title, p.content, s.seo_title, s.meta_description, s.focus_keyword 
    FROM blog_posts p 
    LEFT JOIN blog_seo s ON p.id = s.post_id 
    LIMIT 5
")->fetchAll(PDO::FETCH_ASSOC);

foreach ($posts as $p) {
    echo "Post {$p['id']}: {$p['title']}\n";
    echo "  SEO Title: {$p['seo_title']}\n";
    echo "  Meta Desc: {$p['meta_description']}\n";
    echo "  Focus KW: {$p['focus_keyword']}\n";
    echo "  Content Length: " . strlen($p['content'] ?? '') . "\n\n";
}
