Friday, 27 September 2013

How to add json data to mysql with php with cUrl or file_get_content?

How to add json data to mysql with php with cUrl or file_get_content?

Example Json URL
$url = "somewebsites.com/json.php?id=abc";
Example json data returns
{
"disclaimer": "here comes disclaimer text ",
"license": "Licence details",
"timestamp": 1380312059,
"base": "USD",
"rates": {
"AED": 3.672992,
"AFN": 56.700925,
"ALL": 104.531199,
"AMD": 409.085999,
"ANG": 1.782483
}
}
how can we call & insert this data to 2 mysql tables through cUrl or
file_get_contents
1st table = disclaimer | licence | timestamp | base
2nd table = currencycode (AED) | rate (3.672992)
I am new to php so sorry if its a silly question..

No comments:

Post a Comment