yandoo Posted February 8, 2008 Share Posted February 8, 2008 Hi there, just wanted to know if its ok to have multiple primary keys of different tables (int's) all with auto increment feature?? Is this ok to do or am i like to run into problems if i go down this path?? Thanks Smiley Quote Link to comment Share on other sites More sharing options...
Barand Posted February 8, 2008 Share Posted February 8, 2008 A table can have ONE primary key A table can have ONE auto_increment column which must be defined as a key (so it is normally the PK) Each table should have a primary key. If you want to make each table's PK an auto_inc column then that's fine. Quote Link to comment Share on other sites More sharing options...
yandoo Posted February 8, 2008 Author Share Posted February 8, 2008 Brilliant thanks! I was worried that interactions of different records from different tables with auto number Primary keys may some how get confussed... I know this probably seems like a silly question but is there some way i could have a auto incremented code?? Like Product1, Product2, etc.) as primary key of a table??? Only auto increment in phpmyadmin only works with INT...not VARCHAR.. Thanks Quote Link to comment Share on other sites More sharing options...
Barand Posted February 8, 2008 Share Posted February 8, 2008 auto_inc must be numeric - TINYINT, SMALLINT, INT Quote Link to comment Share on other sites More sharing options...
yandoo Posted February 8, 2008 Author Share Posted February 8, 2008 Cool, Thanks Quote Link to comment Share on other sites More sharing options...
Aureole Posted February 8, 2008 Share Posted February 8, 2008 auto_inc must be numeric - TINYINT, SMALLINT, INT What about MEDIUMINT? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.