PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I've got to create a script to import data from an XML file into a MySQL database. Here is some sample XML data:
[syntax="xml"] <account gm_recid="BS6IJMR+$ ;&<RO" gm_accountno="A6040451231%7R6Q<Bra" >
<properties>
<property name="2" db_name="UP2N" >
<property_string>CMS</property_string>
</property>
<property name="2" db_name="UP2P" >
<property_string>660</property_string>
</property>
</account>
<phone_numbers>
<phone international="1" type="Fax" source_tbl="CONTACT1" source_fld="FAX" >
<properties>
<property name="phone_number" >
<property_string>12345678</property_string>
</property>
</properties>
</phone>
<phone international="1" type="Phone1" source_tbl="CONTACT1" source_fld="PHONE1" >
<properties>
<property name="phone_number" >
<property_string>2345678</property_string>
</property>
<property name="extension" >
<property_string>Work</property_string>
</property>
</properties>
</phone>
</phone_numbers>
<emails>
<email primary="1" gm_recid="BSBASDL&1^TJ<RO" >
<properties>
<property name="email_address" >
<property_string>them@theirdomain.com.au</property_string>
</property>
</properties>
</email>
</emails>
<websites>
<website primary="1" gm_recid="BTBS0R9(>UJSQ9$" >
<properties>
<property name="web_site" >
<property_string>http://www.theirdomain.com.au</property_string>
</property>
</properties>
</website>
</websites>
The import part is easy, it's just reading the XML file... Any tutorials or examples you can point me to?
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I prefer serving web apps off a Mac Classic with a goldfish tennant, but that doesn't make it more practical. Databases weren't designed to store files.... why does everyone insist on doing it?
Don't get me wrong - I've built a DBFS before (and regretted it, but it was a good exercise), and I currently use a db to store file tables....but the files themselves live on the file system.
I simply am importing data from an XML file into a MySQL database, into separate tables and fields, so that I can access that data with my PHP script. I'm not storing any files in a database...