pixeltrace Posted February 25, 2007 Share Posted February 25, 2007 guys, i have my database setup where it has an ID and is set as the primary key and auto increment i set the default value to 0000 however, whenver there's a new item being added. the value of the ID is set to 1 digit only how do i set this up so that my ID will looked like 0001 0002 0003 ..... thanks! Quote Link to comment https://forums.phpfreaks.com/topic/40012-solved-how-to-add-000-to-primary-key/ Share on other sites More sharing options...
magic2goodil Posted February 25, 2007 Share Posted February 25, 2007 Did you try perhaps manually entering the first one as 0001? Quote Link to comment https://forums.phpfreaks.com/topic/40012-solved-how-to-add-000-to-primary-key/#findComment-193520 Share on other sites More sharing options...
pixeltrace Posted February 25, 2007 Author Share Posted February 25, 2007 yes, i did and it still the same what else could be done here? thanks! Quote Link to comment https://forums.phpfreaks.com/topic/40012-solved-how-to-add-000-to-primary-key/#findComment-193522 Share on other sites More sharing options...
pixeltrace Posted February 25, 2007 Author Share Posted February 25, 2007 this is the setup of my ID field field = id type = bigint length = 25 default = extra = auto_increment - primary key Quote Link to comment https://forums.phpfreaks.com/topic/40012-solved-how-to-add-000-to-primary-key/#findComment-193523 Share on other sites More sharing options...
magic2goodil Posted February 25, 2007 Share Posted February 25, 2007 Make the first one 1001? Quote Link to comment https://forums.phpfreaks.com/topic/40012-solved-how-to-add-000-to-primary-key/#findComment-193529 Share on other sites More sharing options...
pixeltrace Posted February 25, 2007 Author Share Posted February 25, 2007 it worked. thanks! Quote Link to comment https://forums.phpfreaks.com/topic/40012-solved-how-to-add-000-to-primary-key/#findComment-193532 Share on other sites More sharing options...
magic2goodil Posted February 25, 2007 Share Posted February 25, 2007 No prob Quote Link to comment https://forums.phpfreaks.com/topic/40012-solved-how-to-add-000-to-primary-key/#findComment-193535 Share on other sites More sharing options...
Barand Posted February 25, 2007 Share Posted February 25, 2007 Use zerofill option in id column definition Quote Link to comment https://forums.phpfreaks.com/topic/40012-solved-how-to-add-000-to-primary-key/#findComment-193548 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.