LOADING
Loading
Hi , welcome back.
LogoutLOGOUT
 
  Lost password?  
Hi
 




 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 08-28-2007, 10:45 AM
[PAUL FERRIE]'s Avatar
[PAUL FERRIE] [PAUL FERRIE] is offline
Glasgow Flash Developer
 
Join Date: Feb 2005
Location: United Kingdom
Posts: 7,756
Rep Power: 16
[PAUL FERRIE] is on a distinguished road
Returning data error

Hi guys,

Well i decided to by a new book: FOED Object Oriented Actionscript 3
So far good read :>

Ok my problem

I am trying to connect to one of my exsisiting database's and display the data in flex.

I ran my php script and it returns the relevant data
PHP Code:

<?PHP

include('../forum/common.php');
$link dbConnect();
$query "SELECT * FROM idblogg ORDER BY newsDate DESC";
$result mysql_query($query);     
if (!
$result) {
    
fail("Couldn't list news stories from database");
}
$newsCount mysql_num_rows($result);
$Return "<newsArchive>";
for (
$count 0$count $newsCount$count++){
    
$news         mysql_fetch_array($result);
    
$newsID     $news['newsID'];
    
$newsTitle     $news['newsTitle'];
    
$newsStory     $news['newsStory'];
    
$newsDate     date("j-m-y"strtotime($news['newsDate']));
    
$newsHits    $news['newsHits'];
    
//
    
$allComms dbQueryFirst("SELECT COUNT(*) AS totalComm FROM idbloggcomm  WHERE blogg_id = $newsID");

    if (!
$allComms) {
           
$newsComms 0;
    } else {
        
$newsComms  $allComms['totalComm'];
    }    
//------------------------------------------------------//    
    
$Return .= "<news>
                    <newsID>"
.$newsID."</newsID>
                    <newsTitle>"
.$newsTitle."</newsTitle>
                    <newsStory>"
.$newsStory."</newsStory>
                    <newsDate>"
.$newsDate."</newsDate>
                    <newsComms>"
.$newsComms."</newsComms>
                    <newsHits>"
.$newsHits."</newsHits>
                </news>"
;    
}
$Return .= "</newsArchive>";
mysql_free_result$result );
print (
$Return);
?>
When i run flex i get this error
Quote:
[RPC Fault faultString="Error #1096: XML parser failure: Unterminated element." faultCode="Client.CouldNotDecode" faultDetail="null"]
at mx.rpc.http::HTTPService/http://www.adobe.com/2006/flex/mx/internal::processResult()
at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::resultHandler()
at mx.rpc::Responder/result()
at mx.rpc::AsyncRequest/acknowledge()
at ::DirectHTTPMessageResponder/completeHandler()
at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunctio n()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/flash.net:URLLoader::onComplete()
"XML parser failure: Unterminated element"

Flex code:
Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" layout="absolute" creationComplete="newsRequest.send()">
   <mx:HTTPService id="newsRequest" url="http://www.domain.com/flex_news_archive.php" useProxy="false" method="POST">
      <mx:request xmlns="">
      </mx:request>
   </mx:HTTPService>
   <mx:TitleWindow x="0" y="0" width="891" height="210" layout="absolute" borderColor="#808080" title="Innovative designs news archive" borderStyle="inset">
      <mx:DataGrid id="dgNewsRequest" x="0" y="1" dataProvider="{newsRequest.lastResult.newsArchive.news}" width="857" height="160">
         <mx:columns>
            <mx:DataGridColumn headerText="news ID" dataField="newsID"/>
            <mx:DataGridColumn headerText="Title" dataField="newsTitle"/>
            <mx:DataGridColumn headerText="Description" dataField="newsDesc"/>
            <mx:DataGridColumn headerText="Submitted" dataField="newsDate"/>
            <mx:DataGridColumn headerText="Comments" dataField="newsComms"/>
            <mx:DataGridColumn headerText="Views" dataField="newsHits"/>
         </mx:columns>
      </mx:DataGrid>
   </mx:TitleWindow>
</mx:Application>
I presume this means that one of the tags is not closed properly?


Thanks
Paul
__________________
.:To me AS is like LEGO, Only for the big Kids :.
- Site - Blog - Glasgow Flasher - Activeden

- bringmadeleinehome.com
Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem returning data from PHP to Flash dreamy129 Server Side 1 11-29-2009 03:15 AM
error 1120, error 1061, cs4 as3 designer09 Flash CS4 2 11-10-2009 08:40 PM
Display Data Grid through .AS File & load user data chosen Actionscript 2.0 0 10-21-2009 09:52 AM
error adding List component iggyKoopa Flash CS4 0 01-05-2009 11:27 AM
Send File and Data at the same time? camilian Flash 8 0 12-31-2005 10:47 PM




All times are GMT. The time now is 09:58 PM.