最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
flash as通过php实现数据库连接方法
时间:2022-06-28 22:43:22 编辑:袖梨 来源:一聚教程网
1.配置php环境
2.启动flex builder
3,new flex project,为project命名为php,再在服务器类型中选择php , 设置的web root(本机web目录)和root url(http地址) , 然后选择data->create application from database 在对话框中选择project为php 点 "new",配置连接名称,然后点next,配置好host url, database name, user name, password 在返回“choose data source” 选择好表名和主键
4 flex 3会自动创建一个与表同名的.mxml文件
利用php来连接数据库
as代码
#include "netservices.as"
netservices.setdefaultgatewayurl("http://your*serv**er.com/flashservices/gateway.php");
gw = netservices.creategatewayconnection();
catalogremote = gw.getservice("catalog", this);
catalogremote.getproducts();getproducts_result = function(result) {
_root.products_results = result;
}
php代码
class catalog {
var $products_array = array();function catalog() {
$this->methodtable = array (
"getproducts" => array (
"description" => "get list of products",
"access" => "remote",
"arguments" => "" // arguments could be optional, not tested
)
);
}function getproducts() {
return $this->products_array;
}
}
相关文章
- 逃离鸭科夫空间怪怎么打 速杀空间怪攻略 11-06
- 逃离鸭科夫偷吃钥匙房怎么偷吃 偷吃钥匙房攻略 11-06
- 逃离鸭科夫箱子潜行怎么打 箱子潜行打法攻略 11-06
- 以闪亮之名云游戏入口在哪 以闪亮之名网页云游戏最新地址 11-06
- 以闪亮之名vip兑换码有哪些 2025最新可用兑换码大全 11-06
- 梦幻西游如何拜师-拜师操作流程 11-06