The structure of the JSON file (prices.json) is very simple:
{"Item1":63.6,"Item2":145.53,"Item3":12.13..........}
I want this to go to db in this way:
Table (analyst)
Row (id): Auto increment ID,
Row (market_name): Item1,
Row (current_price): 63.6,
And keep doing this over and over and over.
Here is what I've done so far:
//connect to mysql db
$con = mysql_connect("root","secret","") or die('Could not connect: ' . mysql_error());
//connect to the employee database
mysql_select_db("csgo", $con);
//read the json file contents
$jsondata = file_get_contents('prices.json');
//convert json object to php associative array
$data = json_decode($jsondata, true);