The More PHP goodies article by Aral Balkan, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-Noncommercial 2.0 UK: England License.
Here's a PHP basic authenticator class by David Wilkinson and a MYSQL recordset to JSON convertor by Adnan Siddiqi. Handy little things.
The More PHP goodies article by Aral Balkan, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-Noncommercial 2.0 UK: England License.
The More PHP goodies article by Aral Balkan, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-Noncommercial 2.0 UK: England License.
nice, good stuff.
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.
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!
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….
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.