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单元测试PHPUnit简单用法示例

本文实例讲述了PHP单元测试PHPUnit简单用法。分享给大家供大家参考,具体如下: windows开发环境下,PHP使用单元测试可以使用PHPUnit。 安装 首先下载PHPUnit,...

PHP实现的一致性HASH算法示例

本文实例讲述了PHP实现的一致性HASH算法。分享给大家供大家参考,具体如下: <?php // +----------------------------------...

php 记录进行累加并显示总时长为秒的结果

现在有一个mysql数据库的test表里有一个duration字段,里面有三条记录: 00:22:32 13:42:21 134:42:21 表示的是时长,但是,保存类型是文本。 现在要...

php计算函数执行时间的方法

本文实例讲述了php计算函数执行时间的方法。分享给大家供大家参考。具体如下: 我们可以通过在程序的前后分别记录开始和结束时间,两个时间差就是程序的执行时间。 <?ph...

php实现将上传word文件转为html的方法

本文实例讲述了php实现将上传word文件转为html的方法。分享给大家供大家参考。具体实现方法如下: 上传页面: <!DOCTYPE html PUBLIC "-//W3C/...