Flash load variable from php/mysql
Posted: Tue Jan 30, 2007 3:33 am
Hello I have a problem: I have a database(mysql) with the following fields:
pdfPath, descrizione, data_creazione
I want to display them into a flash file.
Now my php file called list.php (which collect the information from my database) is the following:
My flash file has 3 input dynamic text (to display the database)called data_creazione, testo, titolo
and I put an actionscript code to call the php file into my flash file here it is:
everything is in one fotogramma: the input dynamic text and the actionscript code.
Can anyone be so kind to tell me why this code do not work?
I really cant' understand why it does not work. the output is completely white..
Thanks
pdfPath, descrizione, data_creazione
I want to display them into a flash file.
Now my php file called list.php (which collect the information from my database) is the following:
Code: Select all
<?php
include_once '../library/config.php';
include_once '../library/opendb.php';
$query =mysql_query("SELECT * FROM `$table` ORDER BY `data_creazione`DESC ");
$cant=0 ;
while($row=mysql_fetch_array($query)){
echo "$cant=$row[pdfPath]&$cant=$row[data_creazione]&$cant=$row[descrizione]";
$cant++;
}
echo "cant=$cant";
?>and I put an actionscript code to call the php file into my flash file here it is:
Code: Select all
myData = new LoadVars()
myData.sendAndLoad("www.ilgertt.it/mazza/cms/list.php",myData,"POST");
myData.onLoad = function(succes){
if(succes){
for(var i=0; i<this.cant; i++){
data_creazione.text = this.data_creazione
testo.text = this.descrizione
titolo.text = this.pdfPath
}
} else trace("Error loading data")
}Can anyone be so kind to tell me why this code do not work?
I really cant' understand why it does not work. the output is completely white..
Thanks