zura08 Posted October 31, 2008 Share Posted October 31, 2008 is'n true is primary key in database should be an interger datatype only???should not be a varchar??this is because if i update the data in database...the data that caontain integer only can be update eventhough i've already set the datatype of primary key is varchar. Quote Link to comment https://forums.phpfreaks.com/topic/130919-update-problem/ Share on other sites More sharing options...
Mchl Posted October 31, 2008 Share Posted October 31, 2008 If you want to use AUTO_INCREMENT, then PK has to be INTEGER. Otherwise not, but it's common practice to have it INTEGER AUTO_INCREMENT. Quote Link to comment https://forums.phpfreaks.com/topic/130919-update-problem/#findComment-679562 Share on other sites More sharing options...
zura08 Posted October 31, 2008 Author Share Posted October 31, 2008 tq for your information Quote Link to comment https://forums.phpfreaks.com/topic/130919-update-problem/#findComment-679602 Share on other sites More sharing options...
Maq Posted October 31, 2008 Share Posted October 31, 2008 the data that caontain integer only can be update eventhough i've already set the datatype of primary key is varchar. Can you explain this more? Are you saying you set the primary key to VAR_CHAR and want to change it to INTEGER AUTO_INCREMENT? It's not very common, but you can have primary keys that aren't INTEGERS. You can also have primary keys that are a combination of fields. Quote Link to comment https://forums.phpfreaks.com/topic/130919-update-problem/#findComment-679607 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.