Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3396068
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T04:21:50+00:00 2026-05-18T04:21:50+00:00

I’m trying to feed data from SQL database to FLEX, using php script in

  • 0

I’m trying to feed data from SQL database to FLEX, using php script in the middle. I see the data in body of message in the Network Monitor and in “Variable” window during debug, but I can’t retrieve them to XML.

Below (event.message.toString())

(mx.messaging.messages::AcknowledgeMessage)#0
  body = "<?xml version="1.0" encoding="UTF-8"?>
<articles>
<node><id>2</id>
<articleid>2</articleid>
<nrporzadkowy>2</nrporzadkowy>
<tresc>moja tresc</tresc>
<rodzaj>textFlow</rodzaj>
</node>
</articles>"
  clientId = "DirectHTTPChannel0"
  correlationId = "C8993E66-DF60-FE63-73D3-6700CA497221"
  destination = ""
  headers = (Object)#1
    DSStatusCode = 200
  messageId = "475F2475-A915-29AB-4364-6700D08BD7D2"
  timestamp = 0
  timeToLive = 0

I’m trying

protected function pobieranieElementow_resultHandler(event:ResultEvent):void
{
    var myXML2:XML = new XML();
    myXML2 =XML(event.result);
}

but then in myXML2 I’m getting only “[object Object]” , when I’m changing casting method to:

protected function pobieranieElementow_resultHandler(event:ResultEvent):void
    {
        var myXML2:XML = new XML();
        myXML2 =event.result as XML;
    }

I’m receiving null in myXML2. I have no idea whats going on ? I’ll post also php script just in case something is wrong there (maybe wrong ‘\n’ signs)

<?php
  header('Content-type: text/xml; charset=utf-8');
  echo '<?xml version="1.0" encoding="utf-8"?>';
  echo "\r\n";
  $link = mysql_connect("HOST", "XXXXX", "XXXXDS");
  mysql_select_db("DATABASEXXXX");
  if (!$link) {
  printf("Connect failed: %s\n", mysql_connect_error());
  exit();
}
  $sql = sprintf("SELECT id,articleid,nrporzadkowy,tresc,rodzaj from elements where articleid = '%s'",$_POST["id"]);
  $result = mysql_query($sql);
  $beg = '<articles>';
  $end = '</articles>';
  echo "$beg\r\n";
  while($row = mysql_fetch_assoc($result))
  {
   echo '<node>';
   echo '<id>';
   echo $row["id"];
   echo '</id>';
   echo "\r\n";
   echo '<articleid>';
   echo $row["articleid"];
   echo '</articleid>';
   echo "\r\n";
   echo '<nrporzadkowy>';
   echo $row["nrporzadkowy"];
   echo '</nrporzadkowy>';
   echo "\r\n";
   echo '<tresc>';
   echo $row["tresc"];
   echo '</tresc>';
   echo "\r\n";
   echo '<rodzaj>';
   echo $row["rodzaj"];
   echo '</rodzaj>';
   echo "\r\n";  
   echo '</node>';
   echo "\r\n";
  }
  echo $end;
  mysql_free_result($result);
  mysql_close($link);
?>

PS
Well I’m able to change nodes to arrayCollection via:

var array:ArrayCollection = event.result.articles.node;

but I can’t feed the dataGrid this way.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T04:21:50+00:00Added an answer on May 18, 2026 at 4:21 am

    OK, ERROR was stupid. I didnt specify the resultFormat in httpService i left it default, and to read xml i should set it to “e4x”

    <mx:HTTPService id="pobieranieElementow" 
                            url="URL" 
                            useProxy="false" 
                            method="POST"
                            result="pobieranieElementow_resultHandler(event)"
                            fault="pobieranie_faultHandler(event)"
                            {this was not set->}**resultFormat="e4x"**>
    

    And now XML(event.result) is working properly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to create an if statement in PHP that prevents a single post
I have a view passing on information from a database: def serve_article(request, id): served_article
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.