Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

MySQL problems

by Kirche (Sexton)
on May 10, 2010 at 11:16 UTC ( [id://839201]=perlquestion: print w/replies, xml ) Need Help??

Kirche has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: MySQL problems
by Corion (Patriarch) on May 10, 2010 at 11:22 UTC

    It's rather unclear to me where your problem actually lies. Are you wondering what SQL to issue? Are you wondering how to format your output? I'm not sure what part of the architecture you mean. Do you mean small parts, like how to pass parameters to DBI? Do you mean large parts, like how to pass the information about what page to show between requests from the user(s)?

    Often, it helps to show a very short, self-contained program that shows what you have. It shouldn't be hard to reduce your program to, say, 20 lines that show what you have, and to also tell us how it is not all you want.

Re: MySQL problems
by CountZero (Bishop) on May 10, 2010 at 13:18 UTC
    If it is an architecture question, then first you must answer some questions, such as: can we have more than one worker assigned to the same work and can one worker be assigned to more than one work?

    Usually, one would have (at least) three tables in the database: one for the works, one for the workers and one which makes a link between works and workers. In that way you can have a many-to-many relationship between works and workers.

    The way it looks now, is that your table "Workers" is a bit like a "Link" table, combined with a "Workers" table. In the long run and to have the maximum flexibility, it is better to split your "Workers" table into "Link" and "Workers".

    There are quite a bit of modules on CPAN for page navigation, such as Data::Paginate, Data::Page and Data::Page::Navigation, Data::Pageset, Data::Pager, (and the list goes on and on). Or for something that is more closely linked to the DBI: DBIx::Pager. Of course frameworks such as DBIx::Class and Catalyst have this functionality already built-in.

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://839201]
Approved by marto
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2024-04-25 22:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found