acidglitter Posted August 8, 2008 Share Posted August 8, 2008 for my primary keys i usually always keep the field type INT, but for my new site i'm thinking it might be easier to use VARCHAR. is that still okay to do? or is it better for a primary key to be a number? Quote Link to comment Share on other sites More sharing options...
revraz Posted August 8, 2008 Share Posted August 8, 2008 As long as it's unique it can be what you want. But you can't auto_increment a VARCHAR. Quote Link to comment Share on other sites More sharing options...
acidglitter Posted August 8, 2008 Author Share Posted August 8, 2008 it won't somehow make queries slower? Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted August 8, 2008 Share Posted August 8, 2008 also var char sorting is different than intger having the values 1,2,10,15,26 as int sort as 1,2,10,15,26 as varchar they sort 1,10,15,2,26 Quote Link to comment Share on other sites More sharing options...
fenway Posted August 9, 2008 Share Posted August 9, 2008 also var char sorting is different than intger The OP sounds like the PK won't be numeric. Quote Link to comment Share on other sites More sharing options...
acidglitter Posted August 16, 2008 Author Share Posted August 16, 2008 i've decided to just keep the primary key an int.. 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.