Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- One to Many Question
November 2, 2005, 2:43 pm
rate this thread
input fields (i.e. 25) for users to enter equipment related
information. As I think about connecting and entering into a MySQL
database, 25 fields or so on one table seems like a lot so I am
thinking about breaking it up into categories. For example the
database name=equipment and tables for pumps, conveyors, shakers, and
'other'. Any thoughts on this folks? I could do the table name as
equipment_tbl for example with its 25 fields but am a little concerned
with how the physical size of this database *might* grow. Feedback is
Re: One to Many Question
fields of equipment like pumps and shakers, but...
from what you have said, I would be looking at
You add a type (say 1,"Pump")
and you add an equip (say 1,1,"Sludge")
from that, you know that the equip record is about a pump ( because its
equip_type_uid = 1 and you can look that up in the type table and find
that type_uid of 1 has a description of "Pump"
Your problem with multiple fields is that if you ever need to search,
you have 25 fields to look in, not one. This way, it is easy to search
(SELECT * FROM equip WHERE equip_info LIKE '%sludge%') and the type
table makes it easy to create dropdown boxes, search by category (no
misspelt "pmup") and you will probably save space, and if you rename
"Pump" to "Liquid Transfer Engines" you only have to do it in one place
(likewise, if you have a Spanish site, you only need another table
"type_es" with 1,Bombe" and all the equipment has Spanish categories.
- » SMARTY templates - is there an easy way to hit all output with a regex to change the URLs
- — Previous thread in » PHP Scripting Forum