Remoting Question

I am doing some remoting with AS3 and having no real luck… I have a PHP method:

function getCollections()
{
$resArray = array();
$sql = “SELECT * from collections”;
return mysql_query($sql, $this->connector->getConnection());
}

If I just do it like shown I can get the return data ok, but I need to urldecode some of the fields first. Normally I would get each row of the query, build an array from it, add that row array to a master array and then return the master… this is what I would do in AS2 / AMFPHP but now in AS3 some things have changed and if I return my master array I’m unable to retrieve the data…

Anyone know what I might be doing wrong? Here’s the code I want to use

function getCollections()
{
$resArray = array();
$sql = “SELECT * from collections”;
//return mysql_query($sql, $this->connector->getConnection());
$result = mysql_query($sql, $this->connector->getConnection());
if(mysql_num_rows($result) > 0){
$row = mysql_fetch_array($result);
}

        while($row){                
            
            $rowArray = array("id"=>$row['id'], "collection"=>urldecode($row['collection']), "adddate"=>$row['adddate']);                
            array_push($resArray, $rowArray);                
            $row = mysql_fetch_array($result);                    
            
        }            
        return $resArray;    
    }