<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Peter,<br>
<br>
Yes, I think mysql_query return a resource type
(<a class="moz-txt-link-freetext" href="http://au2.php.net/manual/en/function.mysql-query.php">http://au2.php.net/manual/en/function.mysql-query.php</a>) and resource
type isn't handled by SWX in the conversion.<br>
<br>
So yes, you'll need to do a mysql_fetch_assoc or something similar to
return a format that's recognised, in this case an array.<br>
<br>
And yes, I do believe the Service Explorer uses amfphp. Vaguely
remember a previous post about this.<br>
<br>
Hope that helps.<br>
<br>
Ben<br>
<br>
<br>
wizkit wrote:
<blockquote cite="mid:4891ACAC.5020203@wizk.it" type="cite">Hello,
  <br>
  <br>
I recently upgraded to a newer version of Flash and lost my Remoting
components and could not work with AMFPHP in Flash anymore. Before
searching for the remoting components I thought to try out SWX as an
alternative since it doesn't require these components. But I stumbled
upon a problem when trying to work with a MySQL resultset. In the
Service Explorer the resultset is shown nicely (because it uses AMFPHP
I guess?), but when I test it in Flash the Data Analyzer returns
  <br>
  <br>
Value = Error 256: Unhandled data type (resource) in
D:\xampp\htdocs\swx\php\SwxAssembler.php, line 145.
  <br>
  <br>
Do I have to turn my resultset into an array? The code I am trying to
get to work is below. If I could get this to work, I could use my
AMFPHP services without modification in SWX, that would be great.<br>
  <br>
Looking forward to your replies.<br>
  <br>
Peter<br>
  <hr size="2" width="100%"><br>
  <b>the SWX Service Method:</b><br>
  <blockquote>function getMenu() <br>
&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; include_once "connect.php"; // some script to connect to your
database<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $sql="SELECT * FROM sometable";<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $rs1 = mysql_query($sql);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return $rs1;<br>
&nbsp;&nbsp;&nbsp; }<br>
  </blockquote>
  <br>
  <b>Actionscript:</b><br>
  <blockquote>import org.swxformat.SWX;<br>
    <br>
var swx:SWX = new SWX();<br>
swx.gateway = <a moz-do-not-send="true" class="moz-txt-link-rfc2396E"
 href="http://localhost/swx/php/swx.php">"http://localhost/swx/php/swx.php"</a>;<br>
swx.debug = true;<br>
    <br>
var callParameters:Object = <br>
&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; serviceClass: "menubar",<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; method: "getMenu",<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; result: [this, resultHandler],<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; args: ""<br>
&nbsp;&nbsp;&nbsp; }<br>
swx.call(callParameters);<br>
    <br>
function resultHandler(event:Object) <br>
{<br>
&nbsp;&nbsp;&nbsp; this.myDatagrid.dataProvider = event.result;<br>
}<br>
    <br>
  </blockquote>
  <pre wrap="">
<hr size="4" width="90%">
_______________________________________________
swx mailing list
<a class="moz-txt-link-abbreviated" href="mailto:swx@osflash.org">swx@osflash.org</a>
<a class="moz-txt-link-freetext" href="http://osflash.org/mailman/listinfo/swx_osflash.org">http://osflash.org/mailman/listinfo/swx_osflash.org</a>
  </pre>
</blockquote>
<br>
</body>
</html>