title: Insert JSON data into MySQL using PHP
body: <p>I tried to insert it to MySQL Base but its not work for me, please help to solve this.
  This is how  JSON looks like:</p>
  
  <pre><code>{
      "status": 1,
      "response": {
          "Aviator Goggles": {
          "price": 1009,
          "quantity": 269
      },
      "Aviator Sunglasses": {
          "price": 460,
          "quantity": 187
      },
      "BIKER CRATE": {
          "price": 29,
          "quantity": 3569
      }
   },
      "time": 1524852778
  }
  </code></pre>
  
  <p>My php code to parse and insert the data:</p>
  
  <pre><code>&lt;?php
  $jsonurl = "https://api.opskins.com/IPricing/GetAllLowestListPrices/v1/?appid=578080&amp;format=json_pretty";
  $json = file_get_contents($jsonurl);
  $data = json_decode($json, true);
  print_r ($data);
  
  mysql_connect("127.0.0.1", "root", "") or die (mysql_error ());
  mysql_select_db("pubg") or die(mysql_error());
  
  foreach($data as $item) {
  
         mysql_query("INSERT INTO `c5f` (response, price, quantity) 
         VALUES ('".$item['response']."','".$item['price']."','".$item['quantity']."')") or die(mysql_error());
       }
  ?&gt;
  </code></pre>