MySQL Forums
Forum List  »  Connector/Node.js

Export table data to XML file
Posted by: Konstantinos Christodoulakis
Date: December 11, 2005 03:26PM

I have a mySQL table named "products" with the following columns:

`products` (
`id` int(11) NOT NULL auto_increment,
`code` int(11) NOT NULL default '0',
`collection` longtext NOT NULL,
`product_name` longtext NOT NULL,
`caption` longtext NOT NULL,
`subtitle` longtext NOT NULL,
`price` varchar(100) NOT NULL default '0',
`status` int(1) NOT NULL default '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=29 ;

How can I export some of the data to an XML file with the following structure, using php ? :

<?xml version="1.0" encoding="utf-8"?>
<collection name="xyz" description="xyz" status="xyz">
<image filename="pic1x.jpg" caption="xyz" />
etc
etc
etc
</collection>

I know I may use an Select SQL Query to select the data, but how can I map them to XML nodes and attributes?

Options: ReplyQuote


Subject
Written By
Posted
Export table data to XML file
December 11, 2005 03:26PM
February 05, 2009 04:58AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.