带有php的Flex4,错误引用功能



我试图连接到MySql数据库在flex4。我写了一个这样的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;

}

我只是把一个数据网格拖放到flex设计模式。然后使用data-> connect to php选项,我从webroot中选择了文件名。php。然后flex4给出这个错误,我不知道它,因为它产生了各种服务。

flex现在期待什么?

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

Description资源路径位置类型通过静态类型String的引用调用可能未定义的方法getNames。flexphp。mxml/flexphp/src line 12 Flex Problem

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

相关内容

最新更新