hi, my name is JIM, new to the FLEX.
i am wishing if some of you guys can help me out here....
and plz help me out here.....
i have no idea how I can solve this problem....
the question is within communication from flex to php
and i already succeed receiving value at PHP side although I can not
send value as array from php.
(Im able to get value at php side from Database)
How can I send value from php to flex?
P.S. sorry for my terrible English.
this is a source
<?php
require_once("DB_Login.php");
$genre_sql = "SELECT column FROM table";
$shop_sql = "SELECT column FROM table";
$data = new getDBData();
$genre_row = $data->get_Data($genre_sql);
$shop_row = $data->get_Data($shop_sql);
$return_Data[] = $genre_row;
$return_Data[] = $shop_row;
//I am thinking the error is the way to return the value
echo $return_Data[];
class getDBData{
function getDBData(){
}
/**
* receive the data, and make it array
* received valueFSQL execute command
* return valueFarray
* */
function get_Data($sql){
// MySQL communicating
if (!($rs = mysql_query($sql))) {
die;
}
// MySQL viewing record
$init = True;
while ($item = mysql_fetch_array($rs)) {
// MySQL init
if ($init) {
// MySQL counting # of records
$clct = count($item) >> 1;
// MySQL checking the name of items
reset($item);
for ($i = 0; $i < $clct; $i++) {
$tmp = each($item); // dummy
$tmp = each($item);
list($mds, $dmy) = $tmp;
}
// MySQL command ended
$init = False;
}
for ($i = 0; $i < $clct; $i++) {
$array[] = $item[$i];
}
}
return $array;
}
}
?>
source code of receiving the value
private function get_Result(event:Event):void
{
var loader:URLLoader = event.target as URLLoader;
var result:Array = loader.data;
//I have no idea how to receive the value here.......
}