php - Parse XML data and import them into mysql -
i have xml array. http://laravel.io/bin/ygzd8#17 , have mysql table. 2 of them have same column names. want add datas mysql table xml. dont want use of column names in mysql insert query. want basic solution loops xml nodes , insert mysql. dont want full of code. want know how can it. tried loop values cant fetch column names in xml. codes in below. can reach values want reach node names.
if( ! $xml = simplexml_load_file('cari.xml') ) { echo 'unable load xml file'; } else { foreach( $xml $element) { echo "blkodu =>".$element->blkodu." </br>"; echo "carikodu =>".$element->carikodu." </br>"; echo "ticari_unvani =>".$element->ticari_unvani." </br>"; echo "ili_1 =>".$element->ili_1." </br>"; echo "----------------"."</br>"; }
Comments
Post a Comment