rubbersoul
IS-IT--Management
OK....here's what I'm trying to do. I want to basically click a button and it populates on dynamic text field showing all the fiels in my one table called players (it's for a hockey league). So I have a database called 'stats' a table in there called 'players' and a bunch of fields (i.e. name, goals etc)...I wrote a .php page with the following code
PHP Code:
<?php
//Set up constants
define ('MYSQL_HOST', 'localhost');
define ('MYSQL_USER', 'myName');
define ('MYSQL_PASS', 'myPassword');
define ('MYSQL_DB', 'stats');
//If we fail to connect
if (! mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS) )
{
die('Failed to connect to host "' . MYSQL_HOST . '".');
}
else
{
echo 'Connected to mysql server ' . MYSQL_HOST . ' as user ' . MYSQL_USER . ' ';
}
//Tell mysql which database to use
mysql_select_db(MYSQL_DB);
echo 'Database ' . MYSQL_DB . ' selected for use.';
//Select entire table
$result = mysql_query('SELECT * FROM players');
echo $result;
?>
** As a side note when I view this page in a browser I get 'Connected to mysql server localhost as user myName
Database stats selected for use.'' So that part looks cool.....
Now for flash....here's where I get stuck....I have a new flash file open with 2 layers. On the first layer I have my dnamic text box and on the second an actions layer. I give the dynamic text box a variable and instance name of 'content' and on the actions layer I assign the following:
PHP Code:
loadVariables(" "this", "GET");
I test in flash and nothing.....I know I'm missing stuff....can any1 help? What I really need is for someone to show me the proper code. What do I have to name the dynamic text box instance and/or variable?
PHP Code:
<?php
//Set up constants
define ('MYSQL_HOST', 'localhost');
define ('MYSQL_USER', 'myName');
define ('MYSQL_PASS', 'myPassword');
define ('MYSQL_DB', 'stats');
//If we fail to connect
if (! mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS) )
{
die('Failed to connect to host "' . MYSQL_HOST . '".');
}
else
{
echo 'Connected to mysql server ' . MYSQL_HOST . ' as user ' . MYSQL_USER . ' ';
}
//Tell mysql which database to use
mysql_select_db(MYSQL_DB);
echo 'Database ' . MYSQL_DB . ' selected for use.';
//Select entire table
$result = mysql_query('SELECT * FROM players');
echo $result;
?>
** As a side note when I view this page in a browser I get 'Connected to mysql server localhost as user myName
Database stats selected for use.'' So that part looks cool.....
Now for flash....here's where I get stuck....I have a new flash file open with 2 layers. On the first layer I have my dnamic text box and on the second an actions layer. I give the dynamic text box a variable and instance name of 'content' and on the actions layer I assign the following:
PHP Code:
loadVariables(" "this", "GET");
I test in flash and nothing.....I know I'm missing stuff....can any1 help? What I really need is for someone to show me the proper code. What do I have to name the dynamic text box instance and/or variable?