[Hpr] How to link multiple hosts in a mysql db
kdmurray at kdmurray.com
Wed May 15 01:14:28 PDT 2013
Normally for something like this I'd have a separate table to link hosts and shows where you could create multiple entries for each show.
On 2013-05-15, at 1:05, Dave Morriss <dave.morriss at gmail.com> wrote:
> On 15/05/13 08:49, Ken Fallon wrote:
>> Those with DB experience might be able to help me out here.
>> Per episode we need to list multiple hosts to a single show. Currently
>> there is only one "host_id" linking to a hosts table that matches to
>> "hosts.id". The hosts table has stuff like id, name, email etc.
>> What is the best/standard way to link the episode to multiple
>> contributors (hosts) in the host table ?
>> episode X has host a b and c.
>> Do I then have a field "contributors" with "a,b,c" in there ?
> Isn't this a many-to-many relationship? An episode can have multiple
> contributors, and a contributor can have many episodes.
> The article at
> explains it for PostgreSQL, but it's a generic solution. You need a
> joining table to express the man-to-many stuff.
> [I once read a book on database design so I'm not an expert!]
> Hpr mailing list
> Hpr at hackerpublicradio.org
More information about the Hpr