here is the java script:var xmlHttpfunction showUser(str){ xmlHttp=GetXmlHttpObject() if (xmlHttp==null) { alert ("Browser does not support HTTP Request") return } var url="getData.php" url=url+"?q="+str url=url+"&sid="+Math.random() xmlHttp.onreadystatechange=stateChanged xmlHttp.open("GET",url,true) xmlHttp.send(null)}function stateChanged() { if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { //document.getElementById("txtHint").innerHTML=xmlHttp.responseText; xmlDoc = xmlHttp.responseXML; document.getElementById('itemnumber').innerHTML= xmlDoc.getElementsByTagName('itemnumber')[0].childNodes[0].nodeValue; document.getElementById('itemcat').innerHTML= xmlDoc.getElementsByTagName('itemcat')[0].childNodes[0].nodeValue; document.getElementById('itemdesc').innerHTML= xmlDoc.getElementsByTagName('itemdesc')[0].childNodes[0].nodeValue; } }function GetXmlHttpObject() { var objXMLHttp=null if (window.XMLHttpRequest) { objXMLHttp=new XMLHttpRequest() } else if (window.ActiveXObject) { objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP") } return objXMLHttp }here is the php code:<?php$q=$_GET["q"];$con = mysql_connect('localhost', 'usrname', 'pwd');if (!$con) { die('Could not connect: '.mysql_error()); }mysql_select_db("myDB", $con);$sql="SELECT itemnumber, itemcat, itemdescFROM item_dataWHERE itemnumber = " . $q;$result = mysql_query($sql);$num = mysql_num_rows($result);if ($num!=0) {echo "<table><tr><th>Count:</th></tr><tr><td>" . $num . "</td></tr></table>";$file= fopen("results.xml", "w") or exit("Unable to open file!");$_xml ="<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\r\n";$_xml .="<item>\r\n";while($row = mysql_fetch_array($result)) { $_xml .= "\t<itemnumber>" . $row['itemnumber'] . "</itemnumber>\r\n"; $_xml .= "\t<itemcat>" . $row['itemcat'] . "</itemcat>\r\n";; $_xml .= "\t<itemdesc>" . $row['itemdesc'] . "</itemdesc>\r\n"; }$_xml .= "</item>";echo $_xml;fwrite($file, $_xml);fclose($file);mysql_close($con); } else { echo "No Records found"; } ?>