Hi thanks for post i made it like you advised but it didn't help here is the code:

###################################################################### +########## # Package MyDictionary::DBI # # Represents object oriented form of my Database package MyDictionary::DBI; use base "Class::DBI::SQLite"; MyDictionary::DBI->set_db('Main', "dbi:SQLite:dbname=Dictionary.db"); ###################################################################### +########## # Package MyDictionary::En_To_Sk # # Represents en_to_sk table package MyDictionary::En_To_Sk; use base "MyDictionary::DBI"; MyDictionary::En_To_Sk->set_up_table('en_to_sk'); MyDictionary::En_To_Sk->columns(All => (eng_id sk_id)); MyDictionary::En_To_Sk->has_a('eng_id' => "MyDictionary::Engword"); MyDictionary::En_To_Sk->has_a('sk_id' => "MyDictionary::Skword"); # Package MyDictionary::Engword # # Represent englishword table package MyDictionary::Engword; use base "MyDictionary::DBI"; MyDictionary::Engword->set_up_table("englishword"); MyDictionary::Engword->columns(Primary => qw/eng_id/); MyDictionary::Engword->columns(All => (eng_id engword)); MyDictionary::Engword->has_many("translations", 'MyDictionary::En_To_S +k', 'eng_id'); #MyDictionary::Engword->has_many('translations',['MyDictionary::En_To_ +Sk' => 'skword'], 'engword'); ###################################################################### +########## # Package MyDictionary::Skword # # Represent skwordmeaning table package MyDictionary::Skword; use base "MyDictionary::DBI"; MyDictionary::Skword->set_up_table("skwordmeaning"); MyDictionary::Skword->columns(Primary => qw/sk_id/); MyDictionary::Skword->columns(All => (sk_id skword)); #MyDictionary::Skword->has_many('translations',['MyDictionary::En_To_S +k' => 'engword'], 'skword'); MyDictionary::Skword->has_many("translations", 'MyDictionary::En_To_Sk +', 'sk_id');
Finally i've done it through DBIx it is better documented with more users. Thanks

In reply to Re^2: Class DBI many to many by zooey
in thread Class DBI many to many by zooey

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.