exec($sql); // Add some sample data if the table is new $stmt = $pdo->query("SELECT COUNT(*) FROM projects"); if ($stmt->fetchColumn() == 0) { $pdo->exec(" INSERT INTO projects (name, client, start_date, status) VALUES ('Downtown Office Tower', 'Big Corp Development', '2026-01-15', 'In Progress'), ('Residential Complex "The Greens"', 'Urban Living Inc.', '2026-03-01', 'Not Started'), ('Bridge Renovation Project', 'City Infrastructure Dept.', '2025-11-20', 'Completed'); "); } } catch (PDOException $e) { // In a real app, you'd log this error. For now, we'll just die. die("Database setup failed: " . $e->getMessage()); } }