Displaying Data from PHP

hey everyone, below is the code I am using for my PHP script and my AS3 function which I am testing :slight_smile:

my PHP script is printing the following:

foo=bar&id_0=1&xfrom_1=100.00&yfrom_2=100.00&xto_3=200.00&yto_4=200.00&xcurrent_5=100.00&ycurrent_6=100.00&typeid_7=1&userid_8=1&date_9=2010-10-14%2019%3A59%3A43&id_0=2&xfrom_1=200.00&yfrom_2=200.00&xto_3=300.00&yto_4=300.00&xcurrent_5=150.00&ycurrent_6=150.00&typeid_7=1&userid_8=1&date_9=2010-10-14%2023%3A45%3A25&numRows=2

as you can see, this looks a mess but this is all printed using some custom functions I have made within PHP. I think this prints just like this, so no point posting the PHP code.

My AS3 function looks like the following:


function InitialSetup(ID:int)
{
	var URLRequestVar:URLRequest = new URLRequest("php/initialsetup.php");
	URLRequestVar.method = URLRequestMethod.POST;
	
	// Build the varLoader variable
	var varLoader:URLLoader = new URLLoader  ;
	varLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
	varLoader.addEventListener(Event.COMPLETE, InitialSetupComplete);
	
	var variables:URLVariables = new URLVariables();
	variables.ID = ID;
	variables.sendRequest = "parse";
	
	URLRequestVar.data = variables;
	// Send the data to the php file
	varLoader.load(URLRequestVar);	
}

	
	
function InitialSetupComplete(event:Event):void
{
	trace (unescape(event.target.data.foo));
	trace (unescape(event.target.data.numRows));
	trace (unescape(event.target.data.msgError));
}

all I get in the output is ‘null’ is there anything really obvious that I am missing here. My head hurts.

When I know the basics of the script are working I am going to be pulling repeat rows, but I need to know I can select a single variable :sigh:

Any help would be much appreciated. Many thanks.