# Remoting Question

**URL:** <https://forum.kirupa.com/t/remoting-question/292611>\
**Category:** flash\
**Created:** [July 16, 2009, 12:07pm UTC](https://forum.kirupa.com/t/remoting-question/292611 "2009-07-16T12:07:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dmennenoh](https://avatars.discourse-cdn.com/v4/letter/d/9dc877/32.png) [@dmennenoh](https://forum.kirupa.com/u/dmennenoh)\
**Post date:** [July 16, 2009, 12:07pm UTC](https://forum.kirupa.com/t/remoting-question/292611/1 "2009-07-16T12:07:22Z")

</div>

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"=&gt;$row['id'], "collection"=&gt;urldecode($row['collection']), "adddate"=&gt;$row['adddate']);                
            array_push($resArray, $rowArray);                
            $row = mysql_fetch_array($result);                    
            
        }            
        return $resArray;    
    }
```
