簡體   English   中英

Flash Builder / php / mysql功能

[英]Flash Builder / php / mysql function

我正在嘗試將PHP函數與Flash Builder配合使用...但是,該函數的返回值是意外的..空白[] (對象)而不是數組。 函數是:

public function getAllAuctions($search) {

        $stmt = mysqli_prepare($this->connection, "SELECT * FROM $this->tablename WHERE name LIKE ?");      
        $this->throwExceptionOnError();

        mysqli_stmt_bind_param($stmt, 'i', $search);        
        $this->throwExceptionOnError();


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

        $rows = array();

        mysqli_stmt_bind_result($stmt, $row->id, $row->name);

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

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

        return $rows;
    }

數據服務-其他工作正常

測試功能

概括起來...我期望收到一個數組,一個mysql搜索查詢的結果; 而是接收一個空白對象: []什么想法嗎?

問題出在綁定參數部分: mysqli_stmt_bind_param($stmt, 'i', $search); ....應該是: mysqli_stmt_bind_param($stmt, 's', $search);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM