flash用php连接数据库的代码
发布于 2014-11-06 14:58:36 | 91 次阅读 | 评论: 0 | 来源: 网友投递
PHP开源脚本语言PHP(外文名: Hypertext Preprocessor,中文名:“超文本预处理器”)是一种通用开源脚本语言。语法吸收了C语言、Java和Perl的特点,入门门槛较低,易于学习,使用广泛,主要适用于Web开发领域。PHP的文件后缀名为php。
本文为大家讲解的是flash用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;
}
相关阅读:
flash用php连接数据库的代码
php读取txt文件组成SQL并插入数据库的代码
用PHP书写安全的脚本代码
用php解析html的示例代码
简单的php写入数据库类代码
PHP备份/还原MySQL数据库的代码
用php过滤危险html代码的函数
用PHP连接Oracle数据库
php使用sql server验证连接数据库的方法
PHP使用ODBC连接数据库的方法
PHP连接数据库实现注册页面的增删改查操作
PHP表单数据写入MySQL数据库的代码