Jump to content

AJAX and XML - Searching XML File

Recommended Posts

I have started out with the code at http://www.w3schools.com/php/php_ajax_xml.asp and modified it to use an input text box instead of a drop down. This text box is to enter a part number, which is marked in the XML file as <partnumber>. The issue I am having is there are possibilites of the same part number being listed multiple times and the code is only pulling up the last time it appeatrs (seems that it may be overwriting the 1st occurance with the 2nd). This would be the same issue with the example unchanged, if you added another album by any of the filtered artist it would pull only the last one in the XML. My question is -- what do I need to do to return all occurances of the input string? I know it should be something in the .php file, and I have tried creating a foreach loop, but it is not working or I am putting it in the wrong place. Can anyone help me solve this?

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...