Well, afaik, there are two ways to pass data back to flash with AMFPHP, either by sending back the mysql resource id which then maps to a ResultSet/RecordSet on the client side, or by passing already fetched arrays, which maps to Array/Objects (or classe objects if you use VO strategy).
If you pass a resource id, you have a recordset object and all the benefits you get from the class. However, sometimes you need to "attach" data from other tables into the returned object, if you pass the resource id, you don´t have such control at the server side. That´s why its sometimes confusing to decide what would be the best method to use... pre-fetch the data and handle pagination and other things or return the resource id and have flash handle all this with the recordset class... I may be wrong on the concepts, if so, please I would be happy if someone could enlight me!
- Marcelo.
On 4/28/06, Julian Sander <[EMAIL PROTECTED]> wrote:
Hi Marcelo,
what I do is put a getDB method on the server which either creates a
new DB connection (I use ADODB) or passes the current DB connection
around to the different methods. As far as I know you cannot pass a
DB connection from AMFPHP to Flash and back as the php remoting class
is instantiated on every new call.
cheers, Julian
On 27.04.2006, at 23:49, Marcelo de Moraes Serpa wrote:
> This maybe a silly question, but sometimes I find myself struggling
> on how method I will use - for example, when I need to attach data
> from a different table I can´t return just the database resource
> id, I need to return the data fetched in an array, however, I find
> that most remoting projects use the RecordSet class to have more
> control on the client side over the server side fetching of data...
> It may depend on what is the nature of data query, but I really
> would love to hear from more experienced remoting/flash
> developers. I´m using AMFPHP and MySQL5.
>
> Thanks,
>
> - Marcelo.
> _______________________________________________
> osflash mailing list
> [email protected]
> http://osflash.org/mailman/listinfo/osflash_osflash.org
_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org
_______________________________________________ osflash mailing list [email protected] http://osflash.org/mailman/listinfo/osflash_osflash.org
