MySQL, PHP, XML, AS2

// get charac_surname from db
function getCharacs() {
	var theXML:XML = new XML();
	theXML.ignoreWhite = true;
	theXML.load("charac.php");
	theXML.onLoad = function() {
		// xml
		var nodes = this.firstChild.childNodes;
		for (i=0; i<nodes.length; i++) {
			var o = {};
			var n = nodes*.childNodes;
			for (var j = 0; j<n.length; j++) {
				o[n[j].nodeName] = n[j].firstChild.nodeValue;
			}
			dg.addItem(o);
			desc.text = "<font color='#FFFFFF'>"+o.Description+"</font>";
			trace(theXML.toString());
		}
	};
}

Hi all,

I’ve got a PHP page generating XML data from a MySQL database, and then being loaded into a DataGrid. The data is being loaded into the dg alright, but I only want some of the data to be loaded in. Everything accept data from a Description column which should go into a text field.

What happens though, is all of the XML is being loaded into the dg, including the Description data, and only the last XML entry’s Description data is being sent to the textfield. I’d like to be able to click on a cell, then have it’s Description data loaded into the textfield.

Many thanks!