# Remoting: Button to load data from MySQL

**URL:** https://forum.kirupa.com/t/remoting-button-to-load-data-from-mysql/305284
**Category:** flash
**Created:** [February 22, 2010, 7:40pm UTC](https://forum.kirupa.com/t/remoting-button-to-load-data-from-mysql/305284 "2010-02-22T19:40:32Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![fxj56911](https://avatars.discourse-cdn.com/v4/letter/f/43a26b/32.png) [@fxj56911](https://forum.kirupa.com/u/fxj56911)
#### Post date: [February 22, 2010, 7:40pm UTC](https://forum.kirupa.com/t/remoting-button-to-load-data-from-mysql/305284/1 "2010-02-22T19:40:32Z")

</div>

Hey guys,  
I’m working on a new project and I’m stuck on this code.

```auto
var nc:NetConnection=new NetConnection();
nc.connect("http://localhost/amfphp/gateway.php");
var res:Responder=new Responder(onResult,onError);
goBtn.addEventListener(MouseEvent.MOUSE_DOWN, btnTrace);
my_ta.visible=false;
nc.call("Tutorials.getInfo",res);
function btnTrace(e:MouseEvent):void
 {
  trace("working fine");
  }
function onResult(e:Object):void
{
 for(var i:int=0;i < e.length;i++)
 {
  my_ta.appendText(+e*.CustomerID+"-"+e*.FirstName+" "
       +e*.LastName+", "
       +e*.DOB+", "
       +e*.Phone+", "
       +e*.Email+"
");
 
 }
 
 my_ta.visible=true;
}
function onError(e:Object):void
{
 my_ta.text=e.toString();
 my_ta.visible=true;
}

```

The code is working good and brings back the info from [COLOR=#0000ff]mysql[/COLOR] via amfphp, but I would like the “goBtn” to bring the info when pressed. Any suggestions would help.
