flash用php连接数据库的代码

yipeiwu_com6年前PHP代码库
php代码:
复制代码 代码如下:

/* /flashservices/services/Catalog.php */
class Catalog {
        var $products_array = array();

// Constructor: Contains the list of methods available to the gateway
function Catalog() {
        $this->methodTable = array (
                "getProducts" => array (
                        "description" => "Get list of products",
                        "access" => "remote",
                        "arguments" => "" // arguments could be optional, not tested
                )
        ); // end methodTable
}

function getProducts() {       
        // your code goes here

        return $this->products_array;
}
}

actionscript代码:
复制代码 代码如下:

#include "NetServices.as"
NetServices.setDefaultGatewayUrl("http://yourserver.com/flashservices/gateway.php");
gw = NetServices.createGatewayConnection();
CatalogREMOTE = gw.getService("Catalog", this);
CatalogREMOTE.getProducts();

getProducts_Result = function(result) {
        _root.products_results = result;

相关文章

php基于协程实现异步的方法分析

本文实例讲述了php基于协程实现异步的方法。分享给大家供大家参考,具体如下: github上php的协程大部分是根据这篇文章实现的:http://nikic.github.io/2012...

php expects parameter 1 to be resource, array given 错误

如果你使用的是封装好的类 例如 function fetch_array($query, $result_type = MYSQL_ASSOC) { return mysql_fetch...

常用的php ADODB使用方法集锦

复制代码 代码如下:<?php        //定义数据库变量   ...

PHP实现普通hash分布式算法简单示例

本文实例讲述了PHP实现普通hash分布式算法。分享给大家供大家参考,具体如下: <?php /* * 普通hash分布式算法 * @param $key * @...

PHP实现可自定义样式的分页类

本文实例为大家分享了PHP实现可自定义样式的分页类,供大家参考,具体内容如下 <?php //namespace Component; /** * 2016-3-...