Passing variables to PHP, getting the URLVariables error!

Hi there, I have written up some code following preivous work. And it seems to me like it is correct. but i am getting the below code when i click on my button to run the function!

Error: Error #2101: The String passed to URLVariables.decode() must be a URL-encoded query string containing name/value pairs.
at Error$/throwError()
at flash.net::URLVariables/decode()
at flash.net::URLVariables()
at flash.net::URLLoader/onComplete()

Please may someone see if they can spot what is going wrong?!
thanks for taking a look!

This is my AS3:

btn_ok.addEventListener(MouseEvent.CLICK, btn_ok_click_handler);

function btn_ok_click_handler(event:MouseEvent):void {
	
	
	var theVariables:URLVariables = new URLVariables();
	theVariables.varEmail = "test@email.com";
	theVariables.varMat1 = "mat1";
	theVariables.varMat2 = "mat2";
	theVariables.varMat3 = "mat3";
	theVariables.varMat4 = "mat4";	
	theVariables.varMat5 = "mat5";	
	theVariables.varMat6 = "mat6";	
	theVariables.varMat7 = "mat7";	
	theVariables.varMat8 = "mat8";	
	theVariables.varMat9 = "mat9";	
	theVariables.varMat10 = "mat10";	
	theVariables.varMat11 = "mat11";
	theVariables.varMat12 = "mat12";	
	theVariables.varMat13 = "mat13";	
	theVariables.varMat14 = "mat14";	
	theVariables.varMat15 = "mat15";	
	theVariables.varMat16 = "mat16";	
	theVariables.varMat17 = "mat17";	
		theVariables.varMat18 = "mat18";	
		theVariables.varMat19 = "mat19";	
		theVariables.varMat20 = "mat20";	
		theVariables.varMat21 = "mat21";	
		theVariables.varMat22 = "mat22";	
		theVariables.varMat23 = "mat23";	
		theVariables.varMat24 = "mat24";	
		theVariables.varMat25 = "mat25";	
	
	
	var theRequest:URLRequest = new URLRequest();
	theRequest.url = "createSampleBook.php";
	theRequest.method = URLRequestMethod.POST;
	theRequest.data = theVariables;
			
	var theLoader:URLLoader = new URLLoader();
	theLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
	theLoader.addEventListener(Event.COMPLETE, loadCompleteHandler);
	theLoader.addEventListener(IOErrorEvent.IO_ERROR, handleIOError);
	theLoader.load(theRequest);
			
	function handleIOError(event:IOErrorEvent):void	{
		event.target.removeEventListener(IOErrorEvent.IO_ERROR, handleIOError);
	}	
		
	function loadCompleteHandler(event:Event):void {
    	
		MovieClip(root).mcMessage.showMessage(event.target.data.feedback);
		MovieClip(root).mcMessage.visible = true;
	
	}
}

This is my file createSampleBook.php

<?php
	@require_once('database.php');
	@require_once('function.php');
	
	if(isset($_POST['varEmail']) && isset($_POST['varMat1']) && isset($_POST['varMat2']) && isset($_POST['varMat3']) && isset($_POST['varMat4']) && isset($_POST['varMat5']) && isset($_POST['varMat6']) && isset($_POST['varMat7']) && isset($_POST['varMat8']) && isset($_POST['varMat9']) && isset($_POST['varMat10']) && isset($_POST['varMat11']) && isset($_POST['varMat12']) && isset($_POST['varMat13']) && isset($_POST['varMat14']) && isset($_POST['varMat15']) && isset($_POST['varMat16']) && isset($_POST['varMat17']) && isset($_POST['varMat18']) && isset($_POST['varMat19']) && isset($_POST['varMat20']) && isset($_POST['varMat21']) && isset($_POST['varMat22']) && isset($_POST['varMat23']) && isset($_POST['varMat24']) && isset($_POST['varMat25'])) {
		
		$result = createSampleBook($_POST['varEmail'], $_POST['varMat1'], $_POST['varMat2'], $_POST['varMat3'], $_POST['varMat4'], $_POST['varMat5'], $_POST['varMat6'], $_POST['varMat7'], $_POST['varMa8'], $_POST['varMa9'], $_POST['varMat10'], $_POST['varMat11'], $_POST['varMat12'], $_POST['varMat13'], $_POST['varMa14'], $_POST['varMa15'], $_POST['varMat16'], $_POST['varMat17'], $_POST['varMat18'], $_POST['varMat19'], $_POST['varMat20'], $_POST['varMat21'], $_POST['varMat22'], $_POST['varMat23'], $_POST['varMat24'], $_POST['varMat25']);
		echo "feedback=".$result;
	}
?>

and this is in my function.php

function createSampleBook($email, $mat1, $mat2, $mat3, $mat4, $mat5, $mat6, $mat7, $mat8, $mat9, $mat10, $mat11, $mat12, $mat13, $mat14, $mat15, $mat16, $mat17, $mat18, $mat19, $mat20, $mat21, $mat22, $mat23, $mat24, $mat25) {
		$sql = "INSERT INTO samples (email, mat1, mat2, mat3, mat4, mat5, mat6, mat7, mat8, mat9, mat10, mat11, mat12, mat13, mat14, mat15, mat16, mat17, mat18, mat19, mat20, mat21, mat22, mat23, mat24, mat25) VALUES ('".$email."', '".$mat1."', '".$mat2."', '".$mat3."', '".$mat4."', '".$mat5."', '".$mat6."', '".$mat7."', '".$mat8."', '".$mat9."', '".$mat10."', '".$mat11."', '".$mat12."', '".$mat13."', '".$mat14."', '".$mat15."', '".$mat16."', '".$mat17."', '".$mat18."', '".$mat19."', '".$mat20."', '".$mat21."', '".$mat22."', '".$mat23."', '".$mat24."', '".$mat25."', '".$allowEdit."')";
		$result = mysql_query($sql)
			or die(mysql_error());
		$sampleBookID = getLastsampleBookId($email);
		return $sampleBookID;
		
			}
			
	function getLastsampleBookId($email) {
		$sql = "SELECT `samples_ID` FROM `samples` WHERE `email` = '".$email."' ORDER BY `samples_ID` DESC LIMIT 0 , 1 ";
		$result = mysql_query($sql)
			or die(mysql_error());
		$row = mysql_fetch_array($result);
		return $row[0];
	}

It’s annoying me, because i have put in test data as above and cannot understand why it’s pulling up the error?!

Any help is really appreciated!