Re: [CDBI] How to acess data through manytomany

[prev] [thread] [next] [Date index for 2006/01/04]

From: Bill Moseley
Subject: Re: [CDBI] How to acess data through manytomany
Date: 19:03 on 04 Jan 2006
On Wed, Jan 04, 2006 at 05:28:41PM +0100, Bernard FRIT wrote:
> What I want is to get all the rows from "Livre" according to a search
> like criteria on "Sousrubrique" but all I can get is an iterator. Is
> there any way to populate an array
> of hashes containing all the essential columns (without any explicit
> programmation) ?

Hope I understand your question:

With Class::DBI::Sweet as your base class you can do joins in your search:

    @albums = Cd->search( { 'artists.artist.name' => $artist_name } );

That generates:


    SELECT me.id, me.title
    FROM   cd me, artist artist, artist_cd artists
    WHERE  ( artist.name = ? ) AND artists.artist = artist.id AND me.id = artists.cd


        -- 
        Bill Moseley
moseley@xxxx.xxx


_______________________________________________
ClassDBI mailing list
ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi

[CDBI] How to acess data through manytomany
Bernard FRIT 16:28 on 04 Jan 2006

Re: [CDBI] How to acess data through manytomany
Perrin Harkins 16:45 on 04 Jan 2006

Re: [CDBI] How to acess data through manytomany
Bill Moseley 19:03 on 04 Jan 2006

Generated at 01:21 on 10 Jan 2006 by mariachi v0.52