ther
17.04.2008, 13:55
вот на сайте нашел якобы метод передачи данных из php
php код
<?php
class pizzaService {
var $ordertable = "amfphp_orders"; // the orders table
var $pizzatable = "amfphp_pizzas"; // the pizzas table
/* mysql_connect and mysql_select_db are in the constructor */
function getOrderList ()
{
$sql = "SELECT o.order_id as orderid, o.order_status as status, o.order_name as name, p.pizza_id as pizzaid, p.pizza_details as details, p.pizza_quantity as quantity FROM $this->ordertable o, $this->pizzatable p WHERE o.order_id = p.order_id AND o.order_status=1 ORDER BY o.order_time";
return mysql_query($sql);
}
/* Other methods below */}
?>
и flash код
import mx.remoting.*;
import mx.rpc.*;
var gatewayUrl:String = "http://amfphp.org/amfphp/gateway.php";
service = new Service(gatewayUrl, null, "pizzaService");
var pc:PendingCall = service.getOrderList();
pc.responder = new RelayResponder(this, "handleGetOrderList", null);
function handleGetOrderList(re:ResultEvent)
{
var rs:RecordSet = RecordSet(re.result);
for(var i = 0; i < rs.length; i++) {
var item = rs.getItemAt(i);
//item is an object with keys orderid, status, etc.
}
}
выдает ошибки
**Error** Symbol=TextPanel, layer=Layer 4, frame=4:Line 18: The class or interface 'PendingCall' could not be loaded.
var pc:PendingCall = service.getOrderList();
**Error** Symbol=TextPanel, layer=Layer 4, frame=4:Line 21: The class or interface 'ResultEvent' could not be loaded.
function handleGetOrderList(re:ResultEvent)
**Error** Symbol=TextPanel, layer=Layer 4, frame=4:Line 23: The class or interface 'RecordSet' could not be loaded.
var rs:RecordSet = RecordSet(re.result);
Total ActionScript Errors: 3 Reported Errors: 3
как можно исправить?или плдскажите корректный способ передачи данных....
php код
<?php
class pizzaService {
var $ordertable = "amfphp_orders"; // the orders table
var $pizzatable = "amfphp_pizzas"; // the pizzas table
/* mysql_connect and mysql_select_db are in the constructor */
function getOrderList ()
{
$sql = "SELECT o.order_id as orderid, o.order_status as status, o.order_name as name, p.pizza_id as pizzaid, p.pizza_details as details, p.pizza_quantity as quantity FROM $this->ordertable o, $this->pizzatable p WHERE o.order_id = p.order_id AND o.order_status=1 ORDER BY o.order_time";
return mysql_query($sql);
}
/* Other methods below */}
?>
и flash код
import mx.remoting.*;
import mx.rpc.*;
var gatewayUrl:String = "http://amfphp.org/amfphp/gateway.php";
service = new Service(gatewayUrl, null, "pizzaService");
var pc:PendingCall = service.getOrderList();
pc.responder = new RelayResponder(this, "handleGetOrderList", null);
function handleGetOrderList(re:ResultEvent)
{
var rs:RecordSet = RecordSet(re.result);
for(var i = 0; i < rs.length; i++) {
var item = rs.getItemAt(i);
//item is an object with keys orderid, status, etc.
}
}
выдает ошибки
**Error** Symbol=TextPanel, layer=Layer 4, frame=4:Line 18: The class or interface 'PendingCall' could not be loaded.
var pc:PendingCall = service.getOrderList();
**Error** Symbol=TextPanel, layer=Layer 4, frame=4:Line 21: The class or interface 'ResultEvent' could not be loaded.
function handleGetOrderList(re:ResultEvent)
**Error** Symbol=TextPanel, layer=Layer 4, frame=4:Line 23: The class or interface 'RecordSet' could not be loaded.
var rs:RecordSet = RecordSet(re.result);
Total ActionScript Errors: 3 Reported Errors: 3
как можно исправить?или плдскажите корректный способ передачи данных....