php - mysql 和 php with reSTLer for webservice

标签 php mysql web-services rest

有谁知道如何编写 reSTLer 代码以与 php 和 mysql 一起工作以生成如下内容:

我想创建一个 XML API Web 服务,但不确定从哪里开始。

我希望人们能够使用 http 请求在数据库中查询以下信息。

数据示例

品牌名称

价格

简短描述

库存单位

示例查询

http://website.com/productxml?dep=1&Count=3&BrandName=Y&Price=Y

我在网上搜索过但找不到任何示例,想知道您是否可以提供帮助,我将如何编写这样的脚本。

提前致谢

罗伊

最佳答案

您可以使用 ReSTLer (http://luracast.com/products/restler/) 并构建一个方法

class YourClass {
    public function productxml($dep, $Count, $BrandName, $Price) {
        // your MySQL stuff
    }
}

处理您的请求。

请参阅示例 ( http://help.luracast.com/restler/examples/) 如何做到这一点。

希望这对您有所帮助。 问候。

关于php - mysql 和 php with reSTLer for webservice,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7783301/

相关文章:

mysql - 使用mysql时 `join`是否每次都生成笛卡尔积?

java - 在 Restful Web 服务中打开 Tomcat 服务器上的 html 文件

php - MySQL PHP 继续结果超出限制

PHPExcel 将 xls DATETIME 更改为数字

php - 使用 "Jquery file upload plugin"直接上传文件到FTP服务器

mysql - 显示 2 没有连接的总和

mysql - 使用Spring Boot Data读取MySQL数据

vb.net - WCF : Could not establish trust relationship for the SSL/TLS secure channel with authority error

java - Keytool 创建受信任的自签名证书

php - WordPress 自定义简码和循环抛出奇怪的结果