I recive this JSON from a site
https://openexchangerates.org/api/latest.json?app_id=1d85872a9b324abcabb2aea5ab397605
and it looks like this.
{
"disclaimer": "Exchange rates...",
"license": "Data sourced from various providers...",
"timestamp": 1433782861,
"base": "USD",
"rates":
{
"BWP": 10.075038,
"CHF": 0.934077,
"CNY": 6.188018,
"EUR": 0.890331,
"GBP": 0.653896,
"ZMW": 7.248788
}
}
How can I insert, or rather periodically update a MySQL database replacing previous values using PHP, MySQL with this structure.
CREATE TABLE IF NOT EXISTS `rate` (
`currency_` varchar(10) NOT NULL Primary key,
`value_` decimal(10,5) NOT NULL
)