我正在尝试在 flash builder 中创建一个移动应用程序。我想使用文本字段来搜索列表,但在我的函数 list_creation 完成处理程序中不断收到此错误
编辑:我正在使用 wamp php 服务器在我的程序中检索数据然后查看它们,因为列表 wordsService2 类是在我创建链接数据库时自动生成的。
错误 1137:参数数量不正确。预计不超过 0。
这是程序的样子:
<s:View>
<fx:Script>
<![CDATA[
import mx.events.FlexEvent;
protected function list_creationCompleteHandler():void
{
getAllWordsResult.token = wordsService2.getAllWords(txt.text);
}
]]>
</fx:Script>
<fx:Declarations>
<s:CallResponder id="getAllWordsResult"/>
<wordsservice2:WordsService2 id="wordsService2"/>
</fx:Declarations>
<s:actionContent>
<s:Button label="Search" click="list_creationCompleteHandler()"/>
</s:actionContent>
<s:navigationContent>
<s:TextInput id="txt" width="242"/>
</s:navigationContent>
<s:List id="list" width="100%" height="100%"
labelField="term">
<s:AsyncListView list="{getAllWordsResult.lastResult}"/>
</s:List>
</s:View>
getallwords
public function getAllWords() {
$stmt = mysqli_prepare($this->connection, "SELECT * FROM $this->tablename");
$this->throwExceptionOnError();
mysqli_stmt_execute($stmt);
$this->throwExceptionOnError();
$rows = array();
mysqli_stmt_bind_result($stmt, $row->id, $row->term, $row->defin, $row->term1, $row->defin1);
while (mysqli_stmt_fetch($stmt)) {
$rows[] = $row;
$row = new stdClass();
mysqli_stmt_bind_result($stmt, $row->id, $row->term, $row->defin, $row->term1, $row->defin1);
}
mysqli_stmt_free_result($stmt);
mysqli_close($this->connection);
return $rows;
}