Jump to content

code not running..please help


bechkam7
 Share

Recommended Posts

"http://www.w3schools.com/php/php_ajax_responsexml.asp"this code is not running..giving error at xmlDoc.getElementsByTagName("firstname")[0].childNodes[0].nodeValue;xmlDoc.getElementsByTagName("firstname")[0] has no propertiesand<?xml version="1.0" encoding="ISO-8859-1"?><person><br /><b>Warning</b>: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in <b>C:\xampp\htdocs\new\getuser.php</b> on line <b>23</b><br /></person>in .php file

Link to comment
Share on other sites

You're speaking very criptically.Is

<?xml version="1.0" encoding="ISO-8859-1"?><person><br />

your (generated?) XML file? If so, then you need to remove the <br /> as this makes the XML file not well formed and thus, unparsable by any XML parser.What exactly is your PHP code, and if it's the same as the example, do you also already have a MySQL DB and table following the described model?

Link to comment
Share on other sites

The XML file looks like the response that is supposed to be coming back from the server, but PHP is throwing out an error message in the middle of it. The break tag is sent by PHP when HTML errors are enabled. It looks like the database query is failing that the statement on line 23 of getuser.php is trying to use.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...