My code:
$go = mysql_query($sql);
$fetch = mysql_fetch_array($go);
$return = Array($fetch[0],$fetch[1],$fetch[2]);
$results = Array(
'body' => Array (
'entry' => Array (
'title' => $return[0],
'image' => $return[1],
'caption' => $return[2]
)
)
);
XML Output:
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<callback xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="schema.xsd">
<body>
<entry>
<title>REHEARSAL DINNER IN SEATTLE, WA</title>
<image>images/portfolio_entries/default.png</image>
<caption>A wonderful in home event for 27 people.</caption>
</entry>
</body>
I want it to loop through all of the rows from the query though and for the xml output to look something like this:
<callback xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="schema.xsd">
<body>
<entry>
<title>REHEARSAL DINNER IN SEATTLE, WA</title>
<image>images/portfolio_entries/default.png</image>
<caption>A wonderful in home event for 27 people.</caption>
</entry>
<entry>
<title>BLAH NUMBER TWO</title>
<image>images/portfolio_entries/default2.png</image>
<caption>Blah blah info about number two.</caption>
</entry>
<entry>
<title>BLAH NUMBER THREE</title>
<image>images/portfolio_entries/default3.png</image>
<caption>blah blah info about number three.</caption>
</entry>
</body>
</callback>