# XML parsing with php4?

**URL:** <https://forum.kirupa.com/t/xml-parsing-with-php4/253270>\
**Category:** programming\
**Created:** [February 28, 2008, 6:45pm UTC](https://forum.kirupa.com/t/xml-parsing-with-php4/253270 "2008-02-28T18:45:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tsid](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/tsid/32/3738_2.png) [@Tsid](https://forum.kirupa.com/u/Tsid)\
**Post date:** [February 28, 2008, 6:45pm UTC](https://forum.kirupa.com/t/xml-parsing-with-php4/253270/1 "2008-02-28T18:45:58Z")

</div>

Hello, I have looked at the tutorial for parsing xml on Kirupa, which is suffice at printing out contents held within an xml file, however, I need to be able to extract records in an xml and input them into a database. The data structure of my XML file is as follows:

```auto
<?xml version="1.0" encoding="UTF-8"?>
<load date="2/25/2008 2:54:01 PM">
  <Data_Xchange name="BAG">
    <record>
      <parameter_list>
        <parameter name="RO">1571358</parameter>
        <parameter name="Status">IN PROCESS</parameter>
        <parameter name="Tag">RFAN</parameter>
        <parameter name="Year">2005</parameter>
      </parameter_list>
    </record>
  </Data_Xchange>
</load>

```

What I’d like to do is be able to extract each record’s attributes and dump them into a corresponding MySQL table. Now, I know how to write the MySQL query to do that, but I don’t know how to use PHP to extract each attribute one record at a time. Can someone help me out on this please? Thanks!:hugegrin:
