query("SELECT * FROM installations ORDER BY created_at DESC LIMIT 10");
$installations = $stmt->fetchAll(PDO::FETCH_ASSOC);
$total_installations = count($installations);
} catch (Exception $e) {
$installations = [];
$total_installations = 0;
$db_error = "Falha na conexão com o banco de dados ou tabela não encontrada. Por favor, execute a migração.";
}
?>
prepare("SELECT image_path FROM installation_images WHERE installation_id = ? ORDER BY id ASC LIMIT 1");
$img_stmt->execute([$inst['id']]);
$first_image = $img_stmt->fetchColumn();
?>