Re: I need suggestion..
| From: | Andreas D. Landmark | Date: | Sat, 29 Sep 2001 19:46:41 +0000 |
| Subject: | Re: I need suggestion.. | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-12843@lists.php.net to get a copy of this message | ||
At 29.09.2001 19:29, you wrote:
Hello All, I need your suggestion, becouse I am starting with PHP and DB. I have website, and on main menu button "Culture" . There is such sub menu: 1. Exhibitions 2. Galleries Information about exhibitions and galleries, must be outputed from DB. There two ways to do this: 1. Create table culture, there field "type" (gallery or exhibition) 2. Create two different tables - galleries and exhibitions. 1 method is OK for me at the mean time, becouse events in (galleries and exhibitions) as I see know, needs the same fields, no difference. But maybe in future I need to add some field only to galleries or to exhibitions but not to both, so I'll face problems, yes? On the method 2 , maybe I'll have difficulties making search system - I'll need to make search, what are culture events, for example from date1 to date2, and no metter if it is gallery or exhibitions, I'll need them put out in to the same window.. How expierienced programmers do this? Thanks..I'd go for solution one with a ENUM/tinyint field to differ between the two. If you need special columns in the future, you might add another table or add a few columns which are only used when appropriate. It's much easier for searching purposes (and all purposes really as it's a bit excessive using two tables for approx. equal data). -- Andreas D Landmark / noXtension Real Time, adj.: Here and now, as opposed to fake time, which only occurs there and then.