2011-09-27 2 views
0

flex4에서 MySql 데이터베이스에 연결하려고합니다. 난 그냥 끌고과 같은 PHP 클래스,flex4 with 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 : 정적 유형 문자열에 대한 참조를 통해 정의되지 않은 방법 getNames에 호출합니다. flexphp.mxml/flexphp/src 줄 12 플렉스 문제

답변

0

PHP 함수는 공개적으로 사용할 수 없기 때문에 Flex와 통신 할 수있는 어떤 종류의 레이어가 없으면 PHP에서 직접 함수를 호출 할 수 없습니다. 이 통신 레이어 (amf remoting)를 제공하는 AMFPHP 또는 ZendPHP을 조사해야합니다.