sasori Posted August 24, 2008 Share Posted August 24, 2008 i got a problem doing a manual alteration of a column, whenever i tried to set a default value of 0 to a column which was presently set to NULL(e.g the cust_id primary key), it doesn't affect the column at all, aren't there any other way to set the default value to 0 manually? coz just like what i said it doesn't affect it manually, ??? Quote Link to comment Share on other sites More sharing options...
centerwork Posted August 24, 2008 Share Posted August 24, 2008 One thing, your cust_id is set to auto_increment. That means that as soon as any new INSERT query is add mysql will automatically update cust_id to the next Auto ID. Thus leave the need for a default of 0 obsolete If you are manually setting cust_id then you need to remove auto_increment. This code might work for you. ALTER TABLE `customer` CHANGE `cust_id` `cust_id` INT( 32 ) NOT NULL DEFAULT '0' Quote Link to comment Share on other sites More sharing options...
sasori Posted August 24, 2008 Author Share Posted August 24, 2008 thanks sir 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.