Historical content: I wrote this article over 6 years ago on 2006-12-20. You are viewing an archived post from my old WordPress blog. The archive contains over 1,500 articles written over a ten year period. The formatting and contents of the posts may not display perfectly.
Serializing recordsets in amfphp in JSON mode goes through the same adapters as it does in amf mode, so you don't have to inspect the inner data, just return mysql_query, and it'll work like it does in the regular amfphp, btw.
by Patrick Mineault on 2006-12-21 02:36:04
Hmm, so maybe I should be using Amfphp for the little app I'm making. Good call. I'd started it before you released the version with JSON so I hadn't even considered it. Thanks!
by aral on 2006-12-21 11:49:14
yeah... i took a look at the new amfphp and it looks really good... thanks for all the hard work patrick!
flash and php are my best friends at the moment... and thanks for the post aral... i'm always on the look out for some good php classes....
by ryan on 2006-12-21 14:10:15
You take a look at the samples.MochiTest in the service browser here:
http://5etdemi.com/amfphp2/browser/
As you can see, getTable returns an ArrayCollection in AMF3 mode. In JSON mode, it returns an object with a columns array and a rows array. You can see it live here:
http://5etdemi.com/amfphp2/samples/ajaxtables/
http://5etdemi.com/amfphp2/samples/spry/
You can take a look at it in Charles or ServiceCapture, it's the same service and the same amfphp install running both. The getTable function looks like this:
function getTable()
{
$table = mysql_query("SELECT * FROM domains");
return $table;
}
With the connection and the db selection being done in the class constructor.
Comments
by flashape on 2006-12-20 22:24:50
by Patrick Mineault on 2006-12-21 02:36:04
by aral on 2006-12-21 11:49:14
by ryan on 2006-12-21 14:10:15
by Patrick Mineault on 2006-12-21 15:50:15