[eluser]vivar[/eluser]
Hi,
Using your array2xml I am very close.
By the way, I should have mentioned that I am querying a view in MySQL (I am very used to using ORACLE) so the category column is just generated using a substring function in SQL at query time.
Anyway, this is the data I have now in xml with the few names I have added to the db:
Code:
<?xml version="1.0" encoding="utf-8"?>
<service version="1.0">
<document>
<0>Aaliyah</0>
<1>Aaron</1>
<2>Abagail</2>
</document>
<document>
<0>Carl</0>
<1>Chris</1>
</document>
<document>
<0>Oliver</0>
</document>
<document>
<0>George</0>
</document>
<document>
<0>Iggy</0>
<1>Isabelle</1>
</document>
<document>
<0>Paul</0>
<1>Peter</1>
</document>
<document>
<0>Sam</0>
<1>Scott</1>
<2>Shawn</2>
</document>
</service>
I am just missing the actual key (ie. 'A' etc.) and I'm not sure where add this to the code so it is included in the XML. I can see the section letter in the $result array:
Code:
Array ( [A] => Array ( [0] =>Aaliyah [1] => Aaron [2] => Abagail ) // etc.
So I know that the required data is there.
Thanks for your help.