Here’s what I’m trying to do …
Im using Flash to call an AMFPHP service that queries my database and returns the result resource. Before returning the result to the Flash movie I need to edit some of the values in the result resource.
How can i iterate through the rows of the result, change some values and ‘repackage’ the resource to return to Flash?
I have thought of –
$sql = sprintf('SELECT file_name FROM ....'); $result = mysql_query($sql); while($row=mysql_fetch_array($result)){ $row['file_name'] = performFunctionOn($row['file_name']); } $row = 0; if(!mysql_data_seek($result,$row))continue; return $result
I am trying to change the filename that is stored in the database and trying to avoid sending a long string back to Flash which i realise is the simple way to do this.
many thanks Stephen
If you want to replace all selected values with a literal constant, you can do the following:
If you want to change your data on the fly, you’ll probably need to derive a custom class from
mysqli_stmtand overridemysqli_stmt::fetchso that is updates the referenced variable after calling parentfetch.Here‘s a nice tutorial on how to derive a custom class from
mysqli_stmt.