In 2008, over one thousand people experienced the world’s first virtual web conference. Together, we created a new type of conference that is environmentally-friendly, affordable, and interactive.

In 2009, we are going to take it one step further.


More PHP goodies

Here's a PHP basic authenticator class by David Wilkinson and a MYSQL recordset to JSON convertor by Adnan Siddiqi. Handy little things.

Creative Commons LicenseThe More PHP goodies article by Aral Balkan, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-Noncommercial 2.0 UK: England License.

Post Metadata

Date
December 20th, 2006

Author
Aral

Tags


5 Comments


  1. 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.



  2. aral

    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!



  3. ryan

    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….


  4. 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.


Leave a Reply



Bad Behavior has blocked 0 access attempts in the last 7 days.