Hi
I need to create a xml feed from a mysql db, via php.
I wanted the feed to be dynamic and always updated, so I figured just to write the feed directly to the browser (echo "<element>data</element>").
Loading the dynamic feed (xmlfeed.php) in the browser works fine (the output is the correct data), but trying to parse the same file as xml with php, givs me this xml error: "XML error: not well-formed (invalid token) at line 1".
If I just write data to a file - "feed.xml" (fwrite ($fp, "<element>data</element>")) and then parsing it, it works fine....
So I am thinking maybee the XML error is a result of trying to open the file "xmlfeed.php" as an xml file and this produces the error because the output has'nt started yet.
So the only way to do this, is to have a cron job producing the xml feed? or is there something I have overlooked or a workaroud?
Any help or comments will of course be much appreciated.
Have a nice one.