php - Import array to mysql table -


array (     [aed] => united arab emirates dirham     [afn] => afghan afghani     [all] => albanian lek     [amd] => armenian dram     [ang] => netherlands antillean guilder     [aoa] => angolan kwanza     [ars] => argentine peso     [aud] => australian dollar ) 

from json decode , want import mysql table like:

id \ code \ name 1  \  aed \ united arab emirates dirham 2  \  afn \ afghan afghani 

and on...

how can this?

use foreach:

foreach($thearray $key => $value) {   mysqli_query($link,"insert table(code,name) values (".$key.",".$value.")"); } 

Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -