This is covered in the manual for mysql . Look up primary key. To create table with primary key the syntax will include: PRIMARY KEY (colname1, colname2 ...)
To alter an existing table will be miore difficult, since you have to ensure the data already in the table does not breach the new primary key rule. The syntax will be ALTER TABLE tablename ADD PRIMARY KEY (colname1, colname2,...) If you havent done so I suggest you download a copy of the manual. As computer manual go it is first class and will cover all that you need. Regards Peter Goggin ----- Original Message ----- From: "toby z" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, October 12, 2002 11:26 PM Subject: making two fields primary key ???? > hi guyz > > i ve to alter my table n make two fields primary key > (well the combination of the two to be xact) > > any idea how to do dis ????? > > > thnx a mill > > toby > > > > > > :S:S:S:S:S:S:S mysql query :S:S:S:S:S:S:S > > > > _________________________________________________________________ > Join the world's largest e-mail service with MSN Hotmail. > http://www.hotmail.com > > > --------------------------------------------------------------------- > 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 > > --------------------------------------------------------------------- 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