SunQuest
           Database Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesDatabase Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old August 5th, 2003, 10:02 PM
cornix cornix is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 8 cornix User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to cornix
Table structure?!?

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?

Reply With Quote
  #2  
Old August 7th, 2003, 07:36 PM
Kwikmeister Kwikmeister is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: South Africa
Posts: 11 Kwikmeister User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to Kwikmeister
RE: Table structure?!?

Try using one table with 2 fields.

The first field is your primary key like an integer value or uniqiue name.

The second field of type longtext is a seperated string containing ur form information.

For example:

header=header_value&field1=field1_value

Then use parse_str() method which will assign all the values to the relevant variables as follows :

$header = 'header_value';

And then dynamically build your form passed on teh variable values.

Reply With Quote
  #3  
Old August 7th, 2003, 08:10 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: Table structure?!?

Thx man, good idea.
I think it also solves the 2nd problem I encountered. If I'd put everything into one table, it'd have about 50 cloumns or sth... Not quite good I'd say.

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesDatabase Help > Table structure?!?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway