Getting Data in Flash from PHP

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Getting Data in Flash from PHP

Postby ketanbengali » 29. June 2005 12:50

Not able to get data from PHP in Flash. Has anybody tried this earlier?
I am able to print in an HTML page but not in Flash. This thing has been working online on my site but not on my local machine in XAMPP.
ketanbengali
 
Posts: 2
Joined: 29. June 2005 12:39

Postby Wiedmann » 29. June 2005 13:09

- XAMPP version?
- code example?
- Flashexample in the demopage works?
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby ketanbengali » 29. June 2005 13:33

[quote="Wiedmann"]-
XAMPP version?
>> 1.4.13

- code example?
PHP
======
<?php
mysql_connect(localhost,$majhaNaav,$guptShabda);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM contacts";
$result=mysql_query($query);

$num=mysql_numrows($result);
$friends = array();
$i=0;

while($i < $num) {
$friends[$i]['firstName'] = mysql_result($result, $i, "firstName");
$friends[$i]['lastName'] = mysql_result($result, $i, "lastName");
$friends[$i]['emailAddress'] = mysql_result($result, $i, "emailAddress");
$friends[$i]['resiPhoneNo'] = mysql_result($result, $i, "resiPhoneNo");
$friends[$i]['officePhoneNo'] = mysql_result($result, $i, "officePhoneNo");
$friends[$i]['mobileNo'] = mysql_result($result, $i, "mobileNo");
$friends[$i]['birthDate'] = mysql_result($result, $i, "birthDate");
//echo mysql_result($result, $i, "firstName"). "\n";
$i++;
}
//print "flashVar=" . urlencode(utf8_encode(serialize($friends)));

//print '&flashVar=' . $friends[0]['firstName'];
print '&flashVar=' . $friends;

?>

Flash Code
=======
var dgsListener:Object = new Object();
dgsListener.load = function() {

var getData:LoadVars = new LoadVars();
getData.load("php/getFriends.php");

getData.onLoad = function(success) {
if(success) {
//contactData = serial.unserialize(this.flashVar);
contactData = this.flashVar;
populateContactDG(contactData);//populates data in DataGrid
}
}
}

}
d2.addEventListener("load", dgsListener);

- Flashexample in the demopage works?
http://www.meritokri.com/flash/addressBook.html
The data here in Flash is been brought by PHP script.
In this case I am also using Sephiroth's serializer class thats the reason
there is that "urlencode(utf8_encode(serialize($friends)))" statement above which I deserialize in flash.
ketanbengali
 
Posts: 2
Joined: 29. June 2005 12:39


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 44 guests