0

Can you please tell me how this thing is called or maybe you can tell me how to make one. I have a mysql database with some rows, for example name, surname. I need to know how to pass those values to a document like this:

<Product>
  <CategoryID>1</CategoryID>
  <Discontinued>false</Discontinued>
  <ProductID>1</ProductID>
  <ProductName>Chai</ProductName>
  <QuantityPerUnit>10 boxes x 20 bags</QuantityPerUnit>
  <ReorderLevel>10</ReorderLevel>
  <SupplierID>1</SupplierID>
  <UnitPrice>18.00</UnitPrice>
  <UnitsInStock>39</UnitsInStock>
  <UnitsOnOrder>0</UnitsOnOrder>
</Product>
ComFreek
  • 29,044
  • 18
  • 104
  • 156
Rokas
  • 1,712
  • 2
  • 18
  • 35
  • Recommended reading: [How to generate XML file dynamically using PHP?](http://stackoverflow.com/q/486757/367456) – hakre Oct 13 '13 at 16:03

2 Answers2

1

You can use SimpleXML in PHP to easily create an XML file: http://php.net/simplexml

hakre
  • 193,403
  • 52
  • 435
  • 836
-1

Probably the simpliest way is using PHP's SimpleXML module.

hakre
  • 193,403
  • 52
  • 435
  • 836
Karol Sikora
  • 522
  • 1
  • 4
  • 11