List:General Discussion« Previous MessageNext Message »
From:Jay Blanchard Date:December 26 2006 1:43pm
Subject:RE: Primary field do I need one
View as plain text  
[snip]
I'm working through (my first day) PHP & MySQL for Dummies and I'm stuck
on
the primary field for my database.
I want to create a racing pigeon results database that has 6 fields
only.
The results will be imported into the database in bulk from a CSV file
Owner - GBring - Ering - Arrivedtime - date - position

If I'm not wrong, surely whichever one of the first 3 fields I create as
a
primary field will stop me entering any races after the first one,
because
every race thereafter will always for the most part be the same owners
and
rings.

So do I have to have a primary key? 
[/snip]

You do not, but it is bad database design. The simplest (but not
necessarily best) thing to do is add an auto-increment column and
declare it as your primary key.

 
Thread
Primary field do I need onemeridklt26 Dec
  • Re: Primary field do I need oneMartijn Tonies26 Dec
  • Re: Primary field do I need onemeridklt26 Dec
  • RE: Primary field do I need oneJerry Schwartz27 Dec
RE: Primary field do I need oneJay Blanchard26 Dec