# Sending from DB to flash

**URL:** <https://forum.kirupa.com/t/sending-from-db-to-flash/152926>\
**Category:** Uncategorized\
**Created:** [June 28, 2005, 5:41am UTC](https://forum.kirupa.com/t/sending-from-db-to-flash/152926 "2005-06-28T05:41:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Trippin](https://avatars.discourse-cdn.com/v4/letter/t/aeb1de/32.png) [@Trippin](https://forum.kirupa.com/u/Trippin)\
**Post date:** [June 28, 2005, 5:41am UTC](https://forum.kirupa.com/t/sending-from-db-to-flash/152926/1 "2005-06-28T05:41:51Z")

</div>

Hi  
I am trying to send data from mySQL database to flash mx 2004.  
well I have a banner and a database with single table called banner and in a table I have ‘id’ and ‘content’ fields.

I downloaded phpObject installed all that … but I can’t work out how to actually in flash on a press of a button query the database and grab info from that content field and display it ???

I am still not having luck with this can someone explain it to me ? here are the bits ( lets get just the data to display from the DB in flash then I’ll worry about getting buttons to trigger this)

## ok so I have a php file called grab.php

\<?  
$db\_name = “rsa”;  
$connection = @mysql\_connect(“203.89.237.71”, “user”, “pass”) or die(“Cound not connect to database”);  
mysql\_select\_db($db\_name, $connection) or die(“Count not select database”);  
$query = “SELECT content FROM banner”;  
$q\_result = mysql\_query($query);  
return mysql\_fetch\_row($q\_result);  
echo “&var1=$q\_result”;

?\>

* * *

I have a flash banner in which I load the phpObject

#include “PHPObject.as”

tmp = new PHPObject();  
tmp.setDefaultGatewayKey(“secret”);  
tmp.setDefaultGatewayUrl(“[http://test.com/phpObject/Gateway.php](http://test.com/phpObject/Gateway.php)”);  
delete tmp;  
myFoo = new PHPObject(“grab”);

Then what do I do ??? how do I reference the grab.php file ???  
and how do I display it in the textfiled instance “myTextField” ???

Please help, thanks

p.s. I know the phpObject works I tested it with a default text.swf it was ok and I have the correct user login for the db etc…
