PDA

View Full Version : PHP & XML



amirag
October 7th, 2005, 10:33 AM
I tried this tutorial http://www.kirupa.com/web/mysql_xml_php.htm (http://www.kirupa.com/web/mysql_xml_php.htm)

and every time i run the code I got this error.

Invalid at the top level of the document. Error processing resource

Data not found.

^

what is the cause of this error?

Voetsjoeba
October 7th, 2005, 03:32 PM
Are you sure you set up the table right ? It writes 'data not found' because the SQL query failed, and that's most likely because the query is targetting data that doesn't exist.

Replace

$resultID = mysql_query($query, $linkID) or die("Data not found.");
with

$resultID = mysql_query($query, $linkID) or die(mysql_error());

And let us know what the output is.

amirag
October 7th, 2005, 09:34 PM
Thank you Voetsjoeba

I replaced the code; it gives the same result after running…

Here’s the exact output
------------------------------------
The XML page cannot be displayed

Cannot view XML input using style sheet. Please correct the error and then click the Refresh (javascript:location.reload()) button, or try again later.




Invalid at the top level of the document. Error processing resource 'http://localhost/testing/php_xml/genratexml_file.php'....

Resource id #1Data not found.^

Voetsjoeba
October 8th, 2005, 04:32 AM
That's weird, there's absolutely no 'data not found' string left in the PHP and yet it still displays that ? :/

amirag
October 8th, 2005, 05:03 PM
Hi again
It wroks fine now…I think the problem was in IIS itself ...after restarting it and adjusting HTTP Headers to Expire Immediately, it wroks very well.
I just wonder why it doesn’t work in the first time!
I think that’s why IIS isn’t recommended for PHP.

Thank you again Voetsjoeba

Voetsjoeba
October 8th, 2005, 05:11 PM
Haha no problem, glad you got it figured out :)