I'm trying to connect to MySql database in flex4. I wrote a php class like this,
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;
}
I just dragged and droped a datagrid into flex design mode. Then using data-> connect to php option, i selected file name.php from webroot. Then flex4 is giving this error, I have no clue about it, since it generated various services.
What is the flex expecting now?
protected function dataGrid_creationCompleteHandler(event:FlexEvent):void
{
getNamesResult.token = name.getNames();
}
Description Resource Path Location Type 1061: Call to a possibly undefined method getNames through a reference with static type String. flexphp.mxml /flexphp/src line 12 Flex Problem