# AS3 getting variable from PHP (limit of only one echo variable?)

**URL:** <https://forum.kirupa.com/t/as3-getting-variable-from-php-limit-of-only-one-echo-variable/287518>\
**Category:** flash\
**Created:** [May 2, 2009, 8:18pm UTC](https://forum.kirupa.com/t/as3-getting-variable-from-php-limit-of-only-one-echo-variable/287518 "2009-05-02T20:18:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shaedo](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@Shaedo](https://forum.kirupa.com/u/Shaedo)\
**Post date:** [May 2, 2009, 8:18pm UTC](https://forum.kirupa.com/t/as3-getting-variable-from-php-limit-of-only-one-echo-variable/287518/1 "2009-05-02T20:18:55Z")

</div>

Hi all, thanks for taking the time, much appreciated.

I want to be able to retrieve several variables from my MySQL database.

Currently my flash sends a request to .php file which then _echos_ all of the variables as a single string.

Flash picks up the string using

```auto
 
var myPHPData:String;
loader.addEventListener(Event.COMPLETE, onConnection);
 function onConnection(evt:Event)
 {
        myPHPData = evt.target.data.writing;
 }

```

and I break up the string to get my variables. Cumbersome and difficult to manage.

I can happily post multiple variables To my .php file. However it/flash seems to append multiple echo statements together and that is when it breaks down.

is there another way?

is there a better way?

I have thought to do several post statements to the PHP and have each one trigger a different echo statement.

I am confused by what I am reading out there and would really appreciate any advice.

thanks!
