# AMFPHP Design Question - Database Query Tool

**URL:** https://forum.kirupa.com/t/amfphp-design-question-database-query-tool/319802
**Category:** flash
**Created:** [March 4, 2011, 7:36pm UTC](https://forum.kirupa.com/t/amfphp-design-question-database-query-tool/319802 "2011-03-04T19:36:58Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![neuflex](https://avatars.discourse-cdn.com/v4/letter/n/96bed5/32.png) [@neuflex](https://forum.kirupa.com/u/neuflex)
#### Post date: [March 4, 2011, 7:36pm UTC](https://forum.kirupa.com/t/amfphp-design-question-database-query-tool/319802/1 "2011-03-04T19:36:58Z")

</div>

Hello All,

just for fun I have been messing around with AMFPHP and I have hit a design problem and I was just wondering if anyone had any input?

I have been using AMFPHP to make calls to a PHP script like so: -

```auto

public function dbconnect(host:String,user:String,pass:String):void {
            trace("Sending Data to AMFPHP");
            // Send the data to the remote server. 
            responder = new Responder(dbResult, onFault);
     
            connection.call("dbtest.dbconnect",responder,host,user,pass);
        }

```

This calls the method “dbconnect” in my PHP script and returns data in a responder method: -

```auto

    private function dbResult(result:Object):void {
              returndata = String(result);
              trace(returndata);
            
        }

```

Anyhow I was looking into making and Database Query Tool so I am going to be making calls to the database via the PHP script depending on what the user selects on the Flash stage.

I was just wondering if its better to use one Responder method to return every call and have that triggered by a custom event or something?

Or use a Responder for every different call to the PHP script?

Any thoughts on a better design?

Thanks in advance 🙂
