Flex / Flash builder : no returning data using database

Posted by Tristan on Stack Overflow See other posts from Stack Overflow or by Tristan
Published on 2010-04-25T13:29:23Z Indexed on 2010/04/25 13:33 UTC
Read the original article Hit count: 441

Filed under:
|
|
|

Hello,

i'm following some flex tutorials everything's working as wanted expected for one thing :

When i use my function getServerByBrand($brand) there is no returned data into my datagrid and i don't know why because it uses the same schema as getAllserver() which is working .

I don't know whether it's cause by the function itselft or the configuration in flash builder :

protected function RechercheGSP_clickHandler(event:MouseEvent):void
        {
            getServerByBrandResult.token = dbClass.getServerByBrand(SearchInput.text);
        }

Here's what i've got in Data/Services :

getServerByBrand(brand : string) : Object

And finally the function :

public function getServerByBrand($brand) {

    $stmt = mysqli_prepare($this->connection, "SELECT DISTINCT * FROM $this->tablename where GSP_nom=? ");
    $this->throwExceptionOnError();

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

    $rows = array();

    mysqli_stmt_bind_result($stmt, $row->idServ, $row->GSP_nom, $row->IPserv, $row->port, $row->tickrate, $row->membre, $row->nomPays, $row->finContrat, $row->actif, $row->timestamp, $row->type, $row->jeux, $row->slot, $row->ipClient, $row->essai, $row->reussite, $row->echec, $row->valide, $row->email);

    while (mysqli_stmt_fetch($stmt)) {
      $row->timestamp = new DateTime($row->timestamp);
      $rows[] = $row;
      $row = new stdClass();
      mysqli_stmt_bind_result($stmt, $row->idServ, $row->GSP_nom, $row->IPserv, $row->port, $row->tickrate, $row->membre, $row->nomPays, $row->finContrat, $row->actif, $row->timestamp, $row->type, $row->jeux, $row->slot, $row->ipClient, $row->essai, $row->reussite, $row->echec, $row->valide, $row->email);
    }

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

    return $rows;
}

I tested the settings with configure return type and it tells me : "the operation returned a primitive "object". test settings : Parameters (brand) / Input type (String) / Value (woop)

To conclude, there is no returned object at all. Do you see the problem ?

Thanks

© Stack Overflow or respective owner

Related posts about flex

Related posts about flash-builder