exec($sql); echo "Table 'missions' created successfully." . PHP_EOL; // Add some initial data for demonstration $stmt = $pdo->query("SELECT COUNT(*) FROM missions"); if ($stmt->fetchColumn() == 0) { $pdo->exec(" INSERT INTO missions (name, drone, status, mission_date) VALUES ('Vineyard Survey', 'DJI Agras T30', 'Completed', '2025-09-25'), ('Pest Control', 'XAG P40', 'In Progress', '2025-09-27'), ('Crop Dusting', 'DJI Agras T30', 'Scheduled', '2025-09-29'); "); echo "Initial data inserted into 'missions' table." . PHP_EOL; } } catch (PDOException $e) { die("DB ERROR: " . $e->getMessage()); }