daten aus sql-db per array an funktion übergeben [Flex 3]
| Beiträge: 2 Registriert: Oct 2011
| 04.10.2011, 06:03
hello there,
ich möchte ein paar int werte aus einer tabelle per array in flex einer methode übergeben.
die php anbindung sieht so aus:
PHP:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
public function getSafetyByVideoIDOnlyID($itemID) {
$stmt = mysqli_prepare($this->connection, "SELECT DISTINCT safetyID FROM videosafety, safety, videos WHERE videosafety.videoID = videos.vidID AND videosafety.sicherheitskey = safety.safetyID AND videos.vidID = ?;");
$this->throwExceptionOnError();
mysqli_stmt_bind_param($stmt, 'i', $itemID);
$this->throwExceptionOnError();
mysqli_stmt_execute($stmt);
$this->throwExceptionOnError();
mysqli_stmt_bind_result($stmt, $row->safetyID);
while (mysqli_stmt_fetch($stmt)) {
$rows[] = $row;
$row = new stdClass();
mysqli_stmt_bind_result($stmt, $row->safetyID);
}
mysqli_stmt_free_result($stmt);
mysqli_close($this->connection);
if (empty($rows)) {
$row = new stdClass();
$row->safetyID = 0;
$row->bezeichnung = 'Kein Eintrag. Bitte einfügen.';
$rows[] = $row;
}
return $rows;
}
|
in flex wollte ich das nun so übergeben:
ActionScript:1 2 3 4 5 6 7 8 | getSafetyByVideoIDOnlyIDResult.token = safetyService.getSafetyByVideoIDOnlyID(vidID);
safetyCheck(getSafetyByVideoIDOnlyIDResult.lastResult);
private function safetyCheck(sIDArr:Array):void
{
showMsg("func.ausgabe: " + sIDArr);
}
|
es müssten zb die werte 3, 5, 7 ausgegeben werden, stattdessen gibt er nur NULL aus.
wie muss ich das anstellen.
btw. ich bin ein absoluter flex noob ;-)
thx | | | Beiträge: 3000 Wohnort: Köln Registriert: Oct 2007
| 04.10.2011, 09:57
|
|