So what I have is every sale (so there are many rows with the same part no.), but I want one XML element per item, and the customers listed as children. I don't have much experience with databases, but since every item has a different number of buyers,.. it's different than having table entries with 'fixed' columns.
Is there an "easy" way to do this (perhaps by means of PHP and querying a mysql database) or would I have to program it on PHP and make conditional statements such as "if the part no. already exists, just add a "customer" child).
I just need to be pointed in the right direction...
Question
Julius Caro
I need to export data to some XML (I can decide on the criteria). I guess nothing to do with sales, but it's easiest analogy I could find:
I have a database table, and each row is a sold item. Colums are stuff like date, item part no. and customer no. (the purchaser).
I want to export data to XML, but I don't want a new root element per sale, I want one per item part no, like this:
So what I have is every sale (so there are many rows with the same part no.), but I want one XML element per item, and the customers listed as children. I don't have much experience with databases, but since every item has a different number of buyers,.. it's different than having table entries with 'fixed' columns.
Is there an "easy" way to do this (perhaps by means of PHP and querying a mysql database) or would I have to program it on PHP and make conditional statements such as "if the part no. already exists, just add a "customer" child).
I just need to be pointed in the right direction...
thanks in advance
Link to comment
Share on other sites
3 answers to this question
Recommended Posts