0

データベースから結果を返そうとしているので、Adobe Flexで使用するXMLファイルを作成し、そこでGoogleマップにデータを入力します。チャールズを使用している現在、次のエラーが発生していますmysql_fetch_assoc(): supplied argument is not a valid MySQL result resource

これが私の関数のコードです:

public function getBusiness ($item)
{
    $stmt = mysqli_prepare($this->connection,

    "SELECT * FROM businesses");

    $this->throwExceptionOnError();

    mysqli_stmt_execute($stmt);

    $this->throwExceptionOnError();

    $row = "";

    echo "<?xml version=\"1.0\" ?><map>";

    while(($row = mysql_fetch_assoc($stmt)) !== false)
    {
        echo "<business><businessid>" . $row["businessid"] . "</businessid>";
        echo "<type>" . $row["type"] . "</type>";
        echo "<name>" . $row["name"] . "</name>";
        echo "<street>" . $row["street"] . "</street>";
        echo "<city>" . $row["city"] . "</city>";
        echo "<country>" . $row["country"] . "</country>";
        echo "<postcode>" . $row["postcode"] . "</postcode>";
        echo "<latitude>" . $row["latitude"] . "</latitude>";
        echo "<longitude>" . $row["longitude"] . "</longitude>";
        echo "<phonenumber>" . $row["phonenumber"] . "</phonenumber>";
        echo "<email>" . $row["email"] . "</email>";
        echo "<website>" . $row["website"] . "</website>";
        echo "<logo>" . $row["logo"] . "</logo>";
        echo "<description>" . $row["description"] . "</description>";
        echo "<datesubmitted>" . $row["datesubmitted"] . "</datesubmitted></business>";
    }
    echo "</map>";


}

誰か助けてもらえますか?

4

2 に答える 2

5

mysqliステートメントの実行に使用していて、結果をmysql?として処理しようとしています。ええ、それはうまくいきません。

同じ拡張子の関数を使用してください!それらは相互互換性がありません。

于 2012-05-21T16:51:35.373 に答える
0

mysql_fetch_assoc()の代わりにfetch_array ()を使用する必要があります

于 2012-05-21T17:32:44.653 に答える