Jump to content

Recommended Posts

Greetings

 

I\'m developing an intranet-based system for filing sampling journals.

 

I have 6 different types (which may get more later) of samples which need different forms. Partially these forms contain parts which may be taken for all different types of samples, for example the header with positional data and so on.

Now the current way I\'m doing it is that I have a totally modular system. I split up the forms, write the code and put them into a DB named form_parts. It\'s set up like this:

 

form_parts

formpart_id

show_form

add_form

add_sql

...

 

Next DB I have is sample_type which connects the samples with the proper form-parts.

 

My question now is: How do I choose the right DB-stucture for the sample data?

 

1. I may continue the modular way: 1 table per form-part (the way I\'m doing it ATM), which ends up in a whole lot of tables (approx. 8 parts per form x 6 samples = 32 tables) which results in a whole lot of chaos :? Pro of this way is that I may add more sample types later easily

 

2. One table per sample type: Much less tables, but double structure for e.g. the header

 

3. One for all, all in one: I could put everything into one table. Would make life easy. Not needed columns would be filled with Null-Values. Proper output would still be given due to the \"show_form\" parts, which pick out the proper parts

 

Which of this 3 would you choose or do you know any better solution?

Link to comment
https://forums.phpfreaks.com/topic/836-table-structure/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.