I've seen it done both ways.  The first way is arguably the simplest, but
the second way to more true to the relational model of data.  Adding a event
type code to distinguish the two types is not a bad idea either, but not a
requirement.

Mike

----- Original Message -----
From: "Ben Luey" <lueyb at gridley.ACNS.Carleton.edu>
To: <tclug-list at mn-linux.org>
Sent: Monday, July 16, 2001 5:53 PM
Subject: [TCLUG] mysql / php question


> I'm trying to create a pretty simple web site in php3 that will use mysql.
> I want php generate a table of upcoming events, sorted by the date and
> time field. There are two types of events, which have different fields
> that I want in the mysql database
>
> type a: location, event name, contact
> type b: person1, person2, email
>
> Do I make a big table with (date, time, event type, location, event name,
> contact, person1, person2, email) and only use the fields appropiate to
> the event type?
>
> Do I make two tables:
>
> table a: date, location, event name, contact
> table b: date, person1, person2, email
>
> Then when I want to make a big table of all events do I join them and sort
> by date / time? Will I need a field in each so I can tell if the data in
> the merged talbe came from table a or table b ( since php will display
> them differently)?
>
> Thanks,
>
> Ben
>
> _______________________________________________
> tclug-list mailing list
> tclug-list at mn-linux.org
> https://mailman.mn-linux.org/mailman/listinfo/tclug-list