[CDBI] Class::DBI and M:M

Arshavir Grigorian grigorian at gmail.com
Sun Mar 18 02:05:44 GMT 2007


Hello,

I have a table "contact" and another table "link" which has 2 foreign keys
to "contact" - contact_id_1 and contact_id_2. This is essentially a
many-to-many relationship, but with only 2 tables. I would like to know how
to handle this with Class::DBI. I would also like to know how to extend
Class::DBI to allow me to search like this:

select contact_id_1 from link where contact_id_2 = ?
union
select contact_id_2 from link where contact_id_1 = ?

Thanks.


Arsh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digitalcraftsmen.net/pipermail/classdbi/attachments/20070317/97eb27ab/attachment.html


More information about the ClassDBI mailing list