Hallo Leute,
Vorab: habe schon reichlich gesucht und probiert und immer nur den Hinweis bekommen, die Datenbank sei nicht i.O. sie müsse normalisiert werden.
Die Datenbank ist aber nun mal so gegeben und nicht von mir.
zu meinem Problem:
Die Datenbank besteht aus normalen Inhalten und einem mit dem Inhalt in Form eines Json.
genau da drinn stehen nun die von mir benötigten Daten.
Hier mal die Datenbank:
CREATE TABLE IF NOT EXISTS `gw2_items` (
`id` MEDIUMINT(6) unsigned NOT NULL,
`signature` varchar(40) COLLATE utf8_bin NOT NULL,
`file_id` int(10) unsigned NOT NULL DEFAULT '0',
`rarity` enum('Junk','Basic','Fine','Masterwork','Rare','Exotic','Ascended','Legendary') COLLATE utf8_bin NOT NULL DEFAULT 'Junk',
`weight` enum('None','Clothing','Light','Medium','Heavy') COLLATE utf8_bin NOT NULL DEFAULT 'None',
`type` enum('None','Armor','Back','Bag','Consumable','Container','CraftingMaterial','Gathering','Gizmo','MiniPet','Tool','Trinket','Trophy','UpgradeComponent','Weapon') COLLATE utf8_bin NOT NULL DEFAULT 'None',
`subtype` tinytext COLLATE utf8_bin NOT NULL,
`unlock_type` tinytext COLLATE utf8_bin NOT NULL,
`level` tinyint(2) unsigned NOT NULL DEFAULT '0',
`value` MEDIUMINT(6) unsigned NOT NULL DEFAULT '0',
`pvp` tinyint(1) unsigned NOT NULL DEFAULT '0',
`attr_name` tinytext COLLATE utf8_bin NOT NULL,
`unlock_id` MEDIUMINT(6) unsigned NOT NULL DEFAULT '0',
`name_de` tinytext COLLATE utf8_bin NOT NULL,
`name_en` tinytext COLLATE utf8_bin NOT NULL,
`name_es` tinytext COLLATE utf8_bin NOT NULL,
`name_fr` tinytext COLLATE utf8_bin NOT NULL,
`data_de` text COLLATE utf8_bin NOT NULL,
`data_en` text COLLATE utf8_bin NOT NULL,
`data_es` text COLLATE utf8_bin NOT NULL,
`data_fr` text COLLATE utf8_bin NOT NULL,
`wikipage_de` int(10) unsigned NOT NULL DEFAULT '0',
`wikipage_en` int(10) unsigned NOT NULL DEFAULT '0',
`wikipage_es` int(10) unsigned NOT NULL DEFAULT '0',
`wikipage_fr` int(10) unsigned NOT NULL DEFAULT '0',
`wiki_de` tinyint(1) unsigned NOT NULL DEFAULT '0',
`wiki_en` tinyint(1) unsigned NOT NULL DEFAULT '0',
`wiki_es` tinyint(1) unsigned NOT NULL DEFAULT '0',
`wiki_fr` tinyint(1) unsigned NOT NULL DEFAULT '0',
`wiki_checked` tinyint(1) unsigned NOT NULL DEFAULT '0',
`updated` tinyint(1) unsigned NOT NULL DEFAULT '0',
`update_time` int(10) unsigned NOT NULL DEFAULT '0',
`date_added` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
der Inhalt von data_de beinhaltet den Json String den ich benötige.:
{"item_id":"73","name":"Duellanten-Maske des Berserkers der Dwayna","description":"","type":"Armor","level":"70","rarity":"Exotic","vendor_value":"295","icon_file_id":"561548","icon_file_signature":"65A0C7367206E6CE4EC7C8CBE07EABAE0191BFBA","game_types":["Activity","Dungeon","Pve","Wvw"],"flags":["SoulBindOnUse"],"restrictions":[],"armor":{"type":"Helm","weight_class":"Medium","defense":"81","infusion_slots":[],"infix_upgrade":{"attributes":[{"attribute":"Power","modifier":"37"},{"attribute":"Precision","modifier":"26"},{"attribute":"CritDamage","modifier":"2"}]},"suffix_item_id":"24768"}}
wie kann ich nun diesen String bzw. relevante Teile ausgeben und die Ausgabe sortieren?
Danke für eure Hilfe.