Re: Design-stage advice and opinions welcomed
Date: Sun, 27 Sep 2015 23:53:46 -0400
Message-ID: <muadge$nnr$1_at_dont-email.me>
On 9/27/2015 11:27 PM, Derek Turner wrote:
> On Fri, 25 Sep 2015 17:38:40 -0500, Gordon Burditt wrote:
>
>> I attend several groups that meet monthly. Generally the best you can >> get farther out than the next month is a *tentative* date, which is >> accurate maybe 80 - 90% of the time
>
> Yep. That's exactly what happens at present. Having read all the answers
> I'm going to go with "These are the normal meetings" Then I'm going to
> have an 'exceptions' table which convenors can populate. Anything else is
> just too much hassle :). I WILL, however, put something in the PHP to
> automatically cancel anything between 24th Dec and 1st Jan inclusive, and
> put a warning about summer and Easter holidays, too.
>
> Thanks for this and all other input, I intend to KISS.
>
I think you'll find handling both a "normal" table and an "exceptions" table to be much harder to handle.
First of all, your "group" table is not normalized (it has duplicated information in I would have one table with the descriptions of the "normal" times, i.e. first and second meeting dates - violation of 1NF).
What happens if some meeting changes and they decide to have it weekly, for instance?
I would have a second table with the group id, meeting id (i.e. 1 or 2) and the meeting date/time ("first tuesday" could work, but limits you - strtotime() is a great function but pretty much limits you to PHP, which may be ok).
Then I would have another table "meetings" with the group id, actual date/time of the meeting and the convener id (conveners can change). This can be pre-filled once a month or once a year or whenever. The meeting information can be changed as necessary.
And if you will have two or more groups meeting together, I would create a link table. Take away the group id from the "meetings" table and replace it with an autoincrement (meeting id). Then create a link table with a group id and the meeting id and fill it in accordingly.
This may all seem like a bit of a hassle - but in the long run it will be a lot less than trying to match information across multiple tables. Proper normalization doesn't require much more work - but makes the code a lot easier to understand and write.
-- ================== Remove the "x" from my email address Jerry Stuckle jstucklex_at_attglobal.net ==================Received on Mon Sep 28 2015 - 05:53:46 CEST