• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 633
  • Last Modified:

Flash Remoting question with AMFPHP

Hi - thanks for reading;

so its my first attempt to return a recordset from php into a datagrid in flash via remoting. I have a datagrid named dgrid on frame one scene one with debig and remoting classes in the library.

Following includes my PHP , AS and the debugger info:

################################

<?php
//PHP ADODB document - made with PHAkt 3.6.0
//Connection statement
require_once('../../Connections/connTTSG.php');

// begin Recordset
$query_rsTest = "SELECT * FROM profiles ORDER BY last_name ASC";
$rsTest = $connTTSG->SelectLimit($query_rsTest) or die($connTTSG->ErrorMsg());
$totalRows_rsTest = $rsTest->RecordCount();
// end Recordset

class  test_tsg {
            // Method Table:
            function test_tsg()
                  {
                  
                  $this->methodTable = array(
                  
                              "getQuery" => array(
                              "description" => "back a resource",
                              "access" => "remote",
                              "returns" => "recordset"
                              )
                  );
                  }
                              
                  
                  // METHOD:
                  
                  function getQuery($col,$tab){
                  return($rsTest);
                  }
}
$rsTest->Close();
?>

################################

import mx.remoting.*;
import mx.rpc.*;
import mx.remoting.debug.*;
import mx.utils.Delegate;
import mx.controls.gridclasses.DataGridColumn;
import mx.controls.Alert;


var gatewayUrl:String = "http://mydomain.com/flashservices/debuggateway.php"
 
NetDebug.initialize();
var _service:Service = new Service(gatewayUrl, null, 'test_tsg', null , null);
var pc:PendingCall = _service.getQuery(1, 20);
pc.responder = new RelayResponder(this, 'handleDoRead', null);
 

//Get data back from server, show the post
      function handleDoRead(re:ResultEvent)
      {
            root.dgrid.dataProvider = RecordSet(re.result);
            }

 function handleError(fe:FaultEvent)
{
      trace('There has been an error');
}


################################

DebugId: "0"
EventType: "Status"
MovieUrl: "file:///C|/flash/main/remoting_test_0.00.swf"
Protocol: "http"
Source: "Client"
Time: 1147485046843
Date (object #1)
....."Fri May 12 21:50:46 GMT-0400 2006"
Status (object #2)
.....code: "AMFPHP_RUNTIME_ERROR"
.....description: "The returned      data was not of      the      expected type resource"
.....details: "/var/www/html/flashservices/amf-core/io/AMFSerializer.php"
.....level: "User Error"
.....line: 548


################################

In the end I am not going to use the datagrid, but will be setting propertied of mc's to values returned from the db so any tips regarding this will be appreciated if you respond. I am retrofitting an existing application that is using the traditional send and load and loadVars methodology.


Sure seems like I am close but just am missing that last bit here or there.

TIA and have a great wekend.
0
MartiniMon
Asked:
MartiniMon
  • 2
1 Solution
 
Dushan De SilvaCommented:
Sometimes following link might help for you.

http://www.kirupa.com/web/index.htm

BR Dushan
0
 
MartiniMonAuthor Commented:
Thanks for responding , I have since solved this issue and am going to request the question be closed.
0
 
MartiniMonAuthor Commented:
Notesd: The query object was not being returned as an aray, I rewrote the query statement and was able to get it to function properly.
0
 
GranModCommented:
Closed, 500 points refunded.
GranMod
The Experts Exchange
Community Support Moderator of all Ages
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now