Re: When does using multiple tables make sense?
| From: | Lester Caine | Date: | Mon, 20 Oct 2008 16:34:37 +0000 |
| Subject: | Re: When does using multiple tables make sense? | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-45542@lists.php.net to get a copy of this message | ||
Jason Pruim wrote:
So my question is... When is it best to use more tables? All the info will be related to each other, so I think I would be looking at either a many-to-many relationship, or a many-to-one relationship (still figuring that out).One thing that I've realised make sense is to have a 'sub-table' for things like phone number, email, fax and the like. All too often we have two phone numbers or different email addresses, so a four field table with ID number, type of info, info, note This way one can add as many info fields of any different type to a client/contact record. The type of info field flags things like primary phone. Address details often need the same treatment as well, but I use UK post code as a key for the bulk of that information so it just goes into a another info field. -- Lester Caine - G8HFL ----------------------------- Contact - http://lsces.co.uk/lsces/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk// Firebird - http://www.firebirdsql.org/index.php