I want to create a table from each JSON attribute I get from a url. This is the kind of JSON input I need to store (8000+ items/attributes):
{
"success": true,
"num_items": 8871,
"items": [
{
"market_name": "\u2605 Bayonet",
"market_hash_name": "\u2605 Bayonet",
"icon_url": "\/\/steamcommunity-a.akamaihd.net\/economy\/image\/-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXU5A1PIYQh5hlcX0nvUOGsx8DdQBJjIAVHubSaKQZ53P3NZXMXvYmykdLSxqWkZ7-HkjMIvpIj3u2Y84733gzh_RU_MG_zIYLEdQ45fxiOrdJh0ExF",
"name_color": "8650AC",
"quality_color": "EB4B4B"
},
{
"market_name": "\u2605 Bayonet | Autotronic (Battle-Scarred)",
"market_hash_name": "\u2605 Bayonet | Autotronic (Battle-Scarred)",
"icon_url": "\/\/steamcommunity-a.akamaihd.net\/economy\/image\/-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXH5ApeO4YmlhxYQknCRvCo04DEVlxkKgpotLu8JAllx8zPYgJA7cW5moWfqPbhJ7TFhGRf4cZOguzA45W70Vfg_RA9MGCncNCUJFM_MgyG_Fa6l-rm0Za5tJrPzCdg73Z343ffzgv330__kcveXQ",
"name_color": "8650AC",
"quality_color": "EB4B4B"
},
{
"market_name": "\u2605 Bayonet | Autotronic (Factory New)",
"market_hash_name": "\u2605 Bayonet | Autotronic (Factory New)",
"icon_url": "\/\/steamcommunity-a.akamaihd.net\/economy\/image\/-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXH5ApeO4YmlhxYQknCRvCo04DEVlxkKgpotLu8JAllx8zPYgJA7cW5moWfqPbhJ7TFhGRf4cZOhuDG_Zi73FbjrUtsaj_3cdORcQJqNw7YrFO5wbzvgZe9vJ3JyHA1uSlx4CqPygv330-muln14A",
"name_color": "8650AC",
"quality_color": "EB4B4B"
},
etc...
Is there a simple way of doing this with PHP? I have tried cramming it all in one RethinkDB table which doesn't work for my case because I need to get the item prices afterwards. I was thinking something like this:
foreach($object.attribute){
do something...
}
I just can't wrap my head around it. Anyways if someone could help that would be great!
Edit: I don't know if I need a table for each item but I need a way to store and add JSON data from a url on the RethinkDB Database using PHP or JavaScript.