# Adding data to a MySQL database using PHP and AS3 in Flash

**URL:** https://forum.kirupa.com/t/adding-data-to-a-mysql-database-using-php-and-as3-in-flash/287576
**Category:** flash
**Created:** [May 3, 2009, 10:49pm UTC](https://forum.kirupa.com/t/adding-data-to-a-mysql-database-using-php-and-as3-in-flash/287576 "2009-05-03T22:49:02Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![gale](https://avatars.discourse-cdn.com/v4/letter/g/a9a28c/32.png) [@gale](https://forum.kirupa.com/u/gale)
#### Post date: [May 3, 2009, 10:49pm UTC](https://forum.kirupa.com/t/adding-data-to-a-mysql-database-using-php-and-as3-in-flash/287576/1 "2009-05-03T22:49:02Z")

</div>

Hi All,

I have managed to connect to my database in flash using php. I need to be able to add records to the database using a flash interface.

Can anyone help?

Here is my existing code:

```auto

stop();

Security.allowDomain("*", "localhost:8888");

var dives_xml_url:String = "http://localhost:8888/pembrokeshire_diving/generate_wrecks_xml.php";

var dives:XML = new XML();
var dives_url:URLRequest = new URLRequest(dives_xml_url);
var divesLoader:URLLoader = new URLLoader(dives_url);

divesLoader.addEventListener(Event.COMPLETE, divesLoaded);

function divesLoaded(e:Event):void
{
    dives = XML(divesLoader.data);
    
    
dives = XML(divesLoader.data);
var il:XMLList = dives.wrecks;
shipname_txt.text = il.ship.text();
depth_txt.text = il.dep.text();
locate_txt.text = il.loc.text();
    
}

```

Obviously I will also need to add buttons and text fields to facilitate adding the data but I wanted to know if it was possible first.

I am using PHP and MySQL with MAMP.

Any help would be really appreciated.

Thank you  
Gale
