Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Well.. I finally got it working the way that I wanted. And yes - a column may appear in more than 1 page.

Here is the way I have designed it.
Table page
page_id page_title
1 Geography
2 History
Table page_column
column page
1 1
2 1
3 1
4 2
Table column
column_id column_title
1 Geog 1
2 Geog 2
3 Geog 3
4 Hist 1

Two things I noticed which Class::DBI required -
1) In table page_column, "column" should be the primary key and not "page"
2) while coding the relationships, its better to use "page" and "column" column names instead of "page_id" and "column_id"

Now the "mapping" stuff as suggested by PodMaster works like a charm, and I can get all columns in page easily.

Thankx a lot for all the help.
I know that this design may not be realistic but it very much suffices me for now.
--
arc_of_descent


In reply to Re: Class::DBI has_many by arc_of_descent
in thread Class::DBI has_many by arc_of_descent

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (6)
As of 2024-03-28 20:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found