cancerinform
07-08-2007, 11:28 PM
Hi,
I am trying to get data from a Mysql database. I constantly got a 2101 error that the variables must contain name/value pairs. I am getting the data from the server back (myResult) to flash but the problem is that even I have two different variables (myResult and matchCounter), they both come back together by calling myResult for the Mysql data, while matchCounter in flash is undefined. You can see what I mean when you test the movie.
http://flashscript.biz/test/search_engine/XMLSearch_Ser_Datagrid.html
Click on one of the radiobuttons (age under 30) and then select a keyword. I am displaying the incoming data in a textfield on the right side. That seems to work. But the number of matches, matchCounter, is also shown and should not, because I am not calling it there. When I ask for the value it gives undefined (undefined matches found).
This is the important part of the php file.
PHP Code:
color: $haircolor</li><li>phone: $phone</li></ul></p></item>";
}
"myResult=" . urlencode($xmlNodes);
}
echo "myResult$theResult=" . urlencode($xmlNodes);
echo "matchCounter$theResult=$matchCounter";
This is what I have inside the completehandler function in Flash.
PHP Code:
mySearchEngine.myMessage.text = event.target.data.matchCounter + " matches found!";//gives undefined
pXml = new XMLDocument ("<items>" + event.target.data.myResult + "</items>");
pXml.ignoreWhite = true;
storeData (pXml.firstChild);
private function storeData (searchText:XMLNode):void
{
mySearchEngine.myField.textValue = searchText;//gives the first child but also shows matchCounter
"myField" is the textfield you see, which currently shows the data in the movie.
The dataformat is VARIABLES. Locally it will always give the 2101 error of course.
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
Any ideas are appreciated :)
I am trying to get data from a Mysql database. I constantly got a 2101 error that the variables must contain name/value pairs. I am getting the data from the server back (myResult) to flash but the problem is that even I have two different variables (myResult and matchCounter), they both come back together by calling myResult for the Mysql data, while matchCounter in flash is undefined. You can see what I mean when you test the movie.
http://flashscript.biz/test/search_engine/XMLSearch_Ser_Datagrid.html
Click on one of the radiobuttons (age under 30) and then select a keyword. I am displaying the incoming data in a textfield on the right side. That seems to work. But the number of matches, matchCounter, is also shown and should not, because I am not calling it there. When I ask for the value it gives undefined (undefined matches found).
This is the important part of the php file.
PHP Code:
color: $haircolor</li><li>phone: $phone</li></ul></p></item>";
}
"myResult=" . urlencode($xmlNodes);
}
echo "myResult$theResult=" . urlencode($xmlNodes);
echo "matchCounter$theResult=$matchCounter";
This is what I have inside the completehandler function in Flash.
PHP Code:
mySearchEngine.myMessage.text = event.target.data.matchCounter + " matches found!";//gives undefined
pXml = new XMLDocument ("<items>" + event.target.data.myResult + "</items>");
pXml.ignoreWhite = true;
storeData (pXml.firstChild);
private function storeData (searchText:XMLNode):void
{
mySearchEngine.myField.textValue = searchText;//gives the first child but also shows matchCounter
"myField" is the textfield you see, which currently shows the data in the movie.
The dataformat is VARIABLES. Locally it will always give the 2101 error of course.
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
Any ideas are appreciated :)