Read data from PHP into Flex app..

First the data in PHP looks like this–

echo “<CALCU>”;

echo “<CALCUS>”;
echo “<ID>”1232″</ID>”;
echo “<AMTSPE>”12365″</AMTSPE>”;
echo “<DATE>”2007/11/11″</DATE>”;
echo “<DESCRY>”hai”</DESCRY>”;
echo “</CALCUS>”; .

echo “</CALCU>”;

Now to get this data into Flex app we got to use HttpService(there are other services) and a property result in it..

<mx:HTTPService id=”srvMain” useProxy=”false” showBusyCursor=”true”
fault=”httperror()” result=”readmeMain(event);”/>

now the result will be fetched into event so to get it define the method as mentioned in the result property of the httpService.. as below..

private function readmeMain(event:ResultEvent):void
{
var amountspe:String=new String;

amountspe=event.result.CALCU.CALCUS.AMTSPE;

}

Now the string amountspe contains the valuse sent by the PHP page(particular as given in colors).

Similarly get other values into strings or inputs..

Advertisements

4 Responses to Read data from PHP into Flex app..

  1. santu says:

    it’s good but,
    i want complete table in php and display it as datagrid in flex

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: