setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $products = [ [ 'name' => 'Royal Kashan Carpet', 'description' => 'A masterpiece of Persian art, this Royal Kashan carpet features a dense, floral pattern with a central medallion. Hand-knotted from pure silk, it offers a luxurious feel and timeless elegance.', 'images' => json_encode(['https://picsum.photos/seed/kashan/800/600', 'https://picsum.photos/seed/kashan2/800/600']), 'material' => 'Silk', 'application' => 'Living Room, Bedroom', 'url_slug' => 'royal-kashan-carpet', 'seo_title' => 'Royal Kashan Silk Carpet | Luxury Persian Rugs', 'seo_meta_description' => 'Discover the exquisite beauty of our hand-knotted Royal Kashan silk carpet. A timeless piece of art for your luxury interior.', 'canonical_url' => '/product/royal-kashan-carpet', 'og_title' => 'Royal Kashan Silk Carpet', 'og_description' => 'A masterpiece of Persian art, this Royal Kashan carpet features a dense, floral pattern with a central medallion.', 'og_image' => 'https://picsum.photos/seed/kashan/1200/630', ], [ 'name' => 'Modern Gabbeh Rug', 'description' => 'This modern Gabbeh rug is characterized by its minimalist design and thick, plush pile. Made from hand-spun wool and natural dyes, it brings warmth and contemporary style to any space.', 'images' => json_encode(['https://picsum.photos/seed/gabbeh/800/600', 'https://picsum.photos/seed/gabbeh2/800/600']), 'material' => 'Wool', 'application' => 'Office, Study', 'url_slug' => 'modern-gabbeh-rug', 'seo_title' => 'Modern Gabbeh Wool Rug | Contemporary Rugs', 'seo_meta_description' => 'Add a touch of contemporary elegance with our hand-woven Modern Gabbeh wool rug. Perfect for modern and minimalist interiors.', 'canonical_url' => '/product/modern-gabbeh-rug', 'og_title' => 'Modern Gabbeh Wool Rug', 'og_description' => 'Characterized by its minimalist design and thick, plush pile, this rug brings warmth and contemporary style.', 'og_image' => 'https://picsum.photos/seed/gabbeh/1200/630', ], [ 'name' => 'Vintage Turkish Kilim', 'description' => 'A beautiful vintage Turkish Kilim, featuring geometric patterns and a rich color palette. This flat-woven rug is a versatile piece that adds a bohemian and historic touch to your home.', 'images' => json_encode(['https://picsum.photos/seed/kilim/800/600', 'https://picsum.photos/seed/kilim2/800/600']), 'material' => 'Wool and Cotton', 'application' => 'Hallway, Kitchen', 'url_slug' => 'vintage-turkish-kilim', 'seo_title' => 'Vintage Turkish Kilim Rug | Bohemian Flat-Weave Rugs', 'seo_meta_description' => 'Explore our collection of vintage Turkish Kilim rugs. Each piece is unique and tells a story of its own, perfect for a bohemian decor.', 'canonical_url' => '/product/vintage-turkish-kilim', 'og_title' => 'Vintage Turkish Kilim Rug', 'og_description' => 'Featuring geometric patterns and a rich color palette, this flat-woven rug is a versatile piece.', 'og_image' => 'https://picsum.photos/seed/kilim/1200/630', ] ]; $stmt = $pdo->prepare( 'INSERT INTO products (name, description, images, material, application, url_slug, seo_title, seo_meta_description, canonical_url, og_title, og_description, og_image) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE name=name' ); foreach ($products as $product) { $stmt->execute(array_values($product)); } echo "Database seeded successfully!\n"; } catch (PDOException $e) { die("Database seeding failed: " . $e->getMessage() . "\n"); }