> Use an index
If you mean use a primary key to create a unique record
regardless of the other data in the row, I've already done
that. However I'm using that primary key as a means of
creating a relationship with another table.
What I don't want, is the same category name and
customerID twice, even if it does have an index column
that differentiates it from other rows.
Because, even if there is an index creating a unique row,
there is still the possibility of 2 of the same categorynames
for one customer. I don't want duplicates like this to
be shown to the user.
Unless I'm misunderstanding what you mean by
using an index...
I'm a bit new to mysql, I've worked a lot with Access,
and I've actually created a flat file relational database
once, but that's it.
Here's the table again:
> >
> > ID INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
> > customerID INT UNSIGNED,
> > categoryname VARCHAR(20)
> >
> > With customer ID pointing to a customers table.
> >
> >
I've tried this:
ID INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
customerID INT UNSIGNED,
categoryname VARCHAR(20) UNIQUE
but I get an error
Right now I'm trying to figure out what, and how
to use an index for my situation, but I find the
mysql docs are badly organized and hard
to read.
any help is much appreciated!
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php