[osflash] [REMOTING] When to return the db resource id?
Marcelo de Moraes Serpa
celoserpa at gmail.com
Fri Apr 28 09:12:13 EDT 2006
Thanks for the reply, Julian.
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 <list at abstractfactory.de> 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
> > osflash at osflash.org
> > http://osflash.org/mailman/listinfo/osflash_osflash.org
>
>
> _______________________________________________
> osflash mailing list
> osflash at osflash.org
> http://osflash.org/mailman/listinfo/osflash_osflash.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/osflash_osflash.org/attachments/20060428/42c8ef4d/attachment.htm
More information about the osflash
mailing list