all groups > flash (macromedia) > november 2005 >
You're in the

flash (macromedia)

group:

reading data from php problem


reading data from php problem qmadd
11/24/2005 9:05:22 PM
flash (macromedia): i have a database called test, with two columns, number and name.
I try to read the data from the database and bring it to Flash
here's my php code: -- load.php

<?
mysql_connect(....);
mysql_select_db(...);
$qr=mysql_query("SELECT from table1 where number=1"); //i have a record with
number=1;
$row=mysql_fetch_array($qr);
$number_flash=$row['number'];
$name_flash=$row['name'];

echo $number_flash;
echo $name_flash;
?>
Flash code:
Btn.onRelease=function()
{
c=new LoadVars();
resp=new Loadvars();
c.sendAndLoad("http://localhost/load.php",resp,"POST");
text1.text=resp['$name_flash'];
}
when i press button it prints "undefined". Anyone knows what is the problem?
Thanks.
Re: reading data from php problem sly one
11/25/2005 12:45:03 AM
Well first this post belongs in the Flash Data Integration forum.

Second, you have stored your data in the loadVars object "c". You need to
extract the data from there. Here's a tutorial:
http://www.actionscript.com/index.php/fw/1/loading-dynamic-content-in-flash/


AddThis Social Bookmark Button