【问题标题】:flex4 with php, error referencing functionflex4与php,错误引用功能
【发布时间】:2011-09-27 21:35:32
【问题描述】:

我正在尝试连接到 flex4 中的 MySql 数据库。我写了一个这样的php类,

public function getNames() {
 $stmt = mysqli_prepare($this->connection,
      "SELECT
          names.firstname,
          names.middlename,
          names.lastname
       FROM names");     

  $this->throwExceptionOnError();

  mysqli_stmt_execute($stmt);
  $this->throwExceptionOnError();

  $rows = array();
  mysqli_stmt_bind_result($stmt, $row->firstname, $row->middlename,
                $row->lastname);

  while (mysqli_stmt_fetch($stmt)) {
      $rows[] = $row;
      $row = new stdClass();
      mysqli_stmt_bind_result($stmt, $row->firstname, $row->middlename,
                $row->lastname);
  }

  mysqli_stmt_free_result($stmt);
  mysqli_close($this->connection);

  return $rows;

}

我只是将一个数据网格拖放到弹性设计模式中。然后使用 data-> connect to php 选项,我从 webroot 中选择了文件 name.php。然后 flex4 给出了这个错误,我对此一无所知,因为它产生了各种服务。

flex 现在期待什么?

 protected function dataGrid_creationCompleteHandler(event:FlexEvent):void
                {
                    getNamesResult.token = name.getNames();
                }

描述资源路径位置类型 1061:通过静态类型 String 的引用调用可能未定义的方法 getNames。 flexphp.mxml /flexphp/src 第 12 行 Flex 问题

【问题讨论】:

    标签: php apache-flex flex4 flash-builder


    【解决方案1】:

    如果没有某种可以与 Flex 通信的层,您不能直接在 PHP 中调用函数,因为 PHP 函数不是公开可用的。您应该查看提供此通信层(amf 远程处理)的 AMFPHP 或 ZendPHP。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-09-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多