View Single Post
01-13-2005, 04:21 PM
#5
tres is offline tres
Status: Sin Binner
Join date: Jan 2005
Location:
Expertise:
Software:
 
Posts: 5
iTrader: 0 / 0%
 

tres is on a distinguished road

  Old

What you have is a classic one to many relationship. In standared MySQL, relationships are not enforced by the database.

1) Use your (unique) primary_key as your foreign keys. i.e.. ad client_id to projects. MySQL will enforce a unique index and not let you add duplicate records.

2) If you merge two client accounts, all you have to do is update the client_id of the affected project records.